Using supertypes of attributes

Michael Pokraka workflow at quirky.me.uk
Thu Jul 1 05:56:29 EDT 2004


Hi Jocelyn,
Thanks, I had a bit of a play around with this, but came up against the s=
ame
problem - or else I don't quite understand what you mean.
The object type is the same - it's the attribute that varies in type. So
there are no 'alternate implementations'.
 
To explain differently: The object is OBJ, with an attribute of object ty=
pe
SUPER. Object type SUPER has subtypes SUB1 SUB2 SUB3. In my flows I
sometimes use a SUB1 container element, other times a SUB2, but all are
obtained via an attribute of the unrelated object OBJ (SUB1-element =3D
OBJ.SUPER).
This is where it complains that 'Object types SUPER and SUB1 are not
compatible'. 'Proper' oo lets you assign compatible types to each other.
Even BOR methods in tasks handle this perfectly well (but most unfortunat=
ely
delegation isn't carried down the chain, but that's a seperate topic).
 
This is largely academic, since creating another attribute isn't exactly =
a
week's work, but still curiosity remains...
 
Thanks for your useful input, it was something I didn't look at too detai=
led
before.
Cheers
Mike
 
Dart, Jocelyn wrote:
> Mike,
> Use an "Interface" object to hold your attributes and/or
> method/parameters/exceptions names and assign the interface to all of t=
he
> relevant objects - each object to provide their own implementation of t=
he
> interface method.
> Same concept as Java "interfaces".
> Jocelyn.
>
> -----Original Message-----
>> From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
> Michael Pokraka
> Sent: Thursday,1 July 2004 12:27 AM
> To: SAP-WUG at MITVMA.MIT.EDU
> Subject: Using supertypes of attributes
>
>
> Hi all,
> I've an attribute 'Sales Document' which is used in different workflows=
 for
> different document types (read: different Business objects). However I'=
m
> struggling to keep it generic, as SAP won't let me assign a VBAK attrib=
ute
> to e.g. a BUS2102 or a BUS2032 container element. The only (nasty)
> workaround I can think of is to create a seperate attribute for each
> document type.
> Now, for methods a task can be created for a common supertype, and you =
can
> call this method with any subtype without a problem. In the OO world th=
is is
> known as polymorpohism. I know this is expecting a bit much from busine=
ss
> objects, but still I'm curious if there is any sneaky way around creati=
ng
> individual attributes....
> Any ideas welcome,
> Cheers
> Mike
>
>
 


More information about the SAP-WUG mailing list