Private Attributes on a Business Object (BUS2121 specifically )

Dart, Jocelyn jocelyn.dart at sap.com
Mon Feb 2 02:52:14 EST 2004


Hi Mark,
The code in standard BUS2121 is verbose as it needs to cater for old versions of EBP.
Instead use function module BBP_PD_SC_GETDETAIL to read any data you need - to avoid
rereads you will still need to store it in private data of your object.
Of course now we can use ABAP objects instead of business objects but unfortunately the
BUS2121 object pre-dates that option.
Regards,
Jocelyn
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of Mark Pyc
Sent: Friday,30 January 2004 9:50 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Private Attributes on a Business Object (BUS2121 specifically)
 
 
G'day Mark,
 
I suffered the same problem with no better solution than you have
identified. The problem comes from the fact that the BOR is Pretend OO.
With everything implemented using Macros rather than genuine objects
things don't behave the way they might. Even if it was genuine OO you
still wouldn't have access unless the attributes were 'Protected' rather
than 'Private' which would mean children only could access them - not even
your children should see your private bits....
 
Private attributes are really only intended for intermediate calculations
etc that would be useful across methods (maybe todays exchange rate....?).
As far as I know they are no more accessible than a local variable
declared via a data statement in the method implementation.
 
In terms of EBP, it seemed a strange choice to me to implement the Item
detail in Private when delegating is such a common requirement. Your code
is not very future proof doing it this way.
 
If there is a better solution I'd love to hear it.
 
Have fun,
Mark
 
 
 
 
 
"Griffiths, Mark" <mark.griffiths at sap.com>
Sent by: SAP Workflow <Owner-SAP-WUG at MITVMA.MIT.EDU>
29/01/2004 16:44
Please respond to SAP Workflow Users' Group
 
 
        To:     SAP-WUG at MITVMA.MIT.EDU
        cc:
        Subject:        Private Attributes on a Business Object (BUS2121 specifically)
 
 
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? (will
SWC_GET_PROPERTY work for example? And if so what is the correct syntax in
this instance)
- What is the point in private attributes anyway? This shopping cart
object is the first time i have really seen them used.
 
If anyone can shed some light on these matters I would very much
appreciate it, otherwise my fall back solution (which works) is to
recreate the private 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 tables).
 
Regards,
 
Mark
 


More information about the SAP-WUG mailing list