Private Attributes on a Business Object (BUS2121 specifically)

Michael Pokraka workflow at quirky.me.uk
Thu Jan 29 14:06:06 EST 2004


Hi Mark,
A private attribute is not really an attribute, but part of the data
declaration. The practical aspect is that it's just a form of static vari=
able
to hold stuff internally. Same as a data statement, but it's scope is acr=
oss
all the code for that object and it's value is persistent throughout the =
life
of the object/instance. Typically it would be something that's required b=
y
more than one attributes/methods internally but needn't be exposed as not=
hing
outside the object would ever be interested in it (you've just disproved =
that
one).
The advantages are to keep things neat, better performance, and the fact =
that
it's the piece of the 'Do not change.. DATA is generated' section that yo=
u are
allowed to change.
 
My own use has been something like:
...begin of private
  myvar type blah.
...
and in various methods I can use object-private-myvar.
 
Of course since this is basically just a glorified data statement it is p=
retty
much inaccessible in other programs - including the subtype.
 
Cheers
Mike
 
Griffiths, Mark wrote:
> Hello There!
>
> I am building an EBP workflow and need to make some enhancements to the
business object.
>
> On my delegated subtype I need to access the Shopping cart item details=
.
Code
> is already written for this in the supertype object and the details are=
 held
in private attributes (not the normal attributes you can see in the tree
structure, but ones created in the very top section of the object program=
 in
the "Create private attributes here" section).
>
> My questions are:
>
> - Is it possible to access these private attributes in my subtype? (wil=
l
SWC_GET_PROPERTY work for example? And if so what is the correct syntax i=
n
this instance)
> - What is the point in private attributes anyway? This shopping cart ob=
ject
is
> the first time i have really seen them used.
>
> If anyone can shed some light on these matters I would very much apprec=
iate
it, otherwise my fall back solution (which works) is to recreate the priv=
ate
attributes and the code to populate them in my subtype (but this is not
great
> for efficiency with both the Sub and Super types hitting the same table=
s).
>
> Regards,
>
> Mark
>
>
 


More information about the SAP-WUG mailing list