Using BOR Object as Attribute In ABAP Class

Mike Pokraka wug at workflowconnections.com
Wed Apr 22 03:21:16 EDT 2009


Very good point, and could well be the cause here. Try changing it to
USR01DOHR explicitly and see if it works then.
All the more reasons to use a user class :-)

On Tue, April 21, 2009 10:48 pm, Dart, Jocelyn wrote:
> Hi Seth/Mike,
> BO USR01 has a weird little feature in that if you are in a system without
> HR it uses USR01 natively and if you are in a system with HR it uses
> USR01DOHR - the employee based equivalent.
> So that might be why you are seeing some strange behaviours. Just a
> thought.
> But I agree with Mike - USR01 is usually my first candidate to redo as an
> ABAP Class that I control.  Similarly BUS1065/EMPLOYEET which have a nasty
> tendency to pay far too much attention to HR Structural Auths, and a nice
> Utilities class for odds and sods such as calculating deadline dates.
> Regards,
> Jocelyn
>
> ________________________________
>
> From: sap-wug-bounces at mit.edu on behalf of Mike Pokraka
> Sent: Tue 21/04/2009 9:43 PM
> To: SAP Workflow Users' Group
> Subject: RE: Using BOR Object as Attribute In ABAP Class
>
>
>
> Sounds like a bug, what patch level are you on?
> If the binding editor can expand the BOR attribute to the BOR component
> level then I'd definitely report it. I've reported a few issues with ABAP
> Classes in WF and found them to be very helpful and usually quite quick in
> resolving issues (which is not what I can say for other areas of OSS).
>
> Cheers,
> Mike
>
>
> On Mon, April 20, 2009 10:47 pm, Stevens, Seth wrote:
>> Yeah, not sure what the issue is here.  Everything is marked as public
>> and the binding editor can see the object and display all the correct
>> attributes; however, the binding syntax check throws the error when you
>> choose one of the attributes.  At this point I'll probably look for a
>> work around but will send out an update if I figure out the issue.
>>
>> Thanks again...
>>
>> --Seth
>>
>> -----Original Message-----
>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
>> Of Mike Pokraka
>> Sent: Monday, April 20, 2009 4:34 PM
>> To: SAP Workflow Users' Group
>> Subject: RE: Using BOR Object as Attribute In ABAP Class
>>
>> Hi Seth,
>>
>> You're on the right track, but missing the bit that the binding editor
>> won't instantiate the class. If you make the constant public (so the
>> binding editor can see it) and specify it as the initial value for your
>> attribute it should be happy. I think. Not sure how/why it's working in
>> one instance but not the other - see if you can expand the attribute in
>> a regular binding.
>>
>> Regarding a user class, I still say go for it. It's easier to work with
>> and far more flexible and there's nothing stopping you from mixing and
>> matching. I often end up with BOR and classes for the same object.
>> Basically I take an opportunistic approach: if I need to spend any time
>> working with a BOR object then it's a good excuse to add the
>> functionality to a class instead (provided it's not a major effort).
>> Regarding maintaining two code streams - just mark the BOR method
>> obsolete. If it needs changing then do it the other way around:
>> incorporate the class into your BOR object as a private attribute,
>> change the code in the class and replace your BOR method code to call
>> the class method. Although BOR doesn't understand classes as components,
>> you can instantiate and use a class internally because it's standard
>> ABAP.
>>
>> Cheers,
>> Mike
>>
>>
>> On Mon, April 20, 2009 3:08 pm, Stevens, Seth wrote:
>>> Mike,
>>>
>>> Thanks for the reply.  I assume that you are talking about setting an
>>> initial value in the class and not in the workflow container, if that
>>> is the case I am already doing this.  I have created a constant with
>>> "direct type entry" like below:
>>>
>>> BEGIN OF C_BOR_USR01,
>>>   INSTID TYPE SIBFBORIID VALUE IS INITIAL,
>>>   TYPEID TYPE SIBFTYPEID VALUE 'USR01',
>>>   CATID  TYPE SIBFCATID VALUE 'BO',
>>> END OF C_BOR_USR01.
>>>
>>> I then created an attribute called TRADER_BOR_USR01 of type SIBFLPORB
>>> and placed the below code in the constructor.
>>>
>>> ME->TRADER_BOR_USR01-INSTID = 'MYUSERID'.
>>> ME->TRADER_BOR_USR01-TYPEID = 'USR01'.
>>> ME->TRADER_BOR_USR01-CATID = 'BO'.
>>>
>>> The binding editor in the workflow builder shows all the correct
>>> attributes and structure of the USR01 business object so I assume the
>>> editor is reading the correct BO type; however, if I select one of the
>>
>>> attributes and try to use it I get the error.  If you see anything I'm
>>
>>> missing please let me know.
>>>
>>> As far as creating a user class, this is something I would like to do.
>>> My only issue is this is our only class based workflow thus far and we
>>
>>> have tons of BOR based workflows.  I don't want to have to maintain
>>> all the custom code associated with the user object in two places.  I
>>> guess I could create a wrapper class for the BO then maintain the code
>>
>>> in the BOR until when/if we convert our old workflows to use the
>> class.
>>> Regardless, I'd still like to figure this problem out for use
>> elsewhere.
>>>
>>> Thanks in advance.
>>>
>>> --Seth
>>>
>>> ________________________________
>>>
>>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
>>> Behalf Of Mike Pokraka
>>> Sent: Saturday, April 18, 2009 4:35 PM
>>> To: 'SAP Workflow Users' Group'
>>> Subject: RE: Using BOR Object as Attribute In ABAP Class
>>>
>>>
>>>
>>> Hmmm, reading my own post I notice a bit of confusion. Let's try that
>>> second sentence again:
>>>
>>> The attribute needs to be populated with an initial value that
>>> contains at least the object class and type.
>>>
>>>
>>>
>>>
>>>
>>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
>>> Behalf Of Mike Pokraka
>>> Sent: 18 April 2009 20:12
>>> To: 'SAP Workflow Users' Group'
>>> Subject: RE: Using BOR Object as Attribute In ABAP Class
>>>
>>>
>>>
>>> Hi Seth,
>>>
>>>
>>>
>>> The problem is that the binding editor does not know the object type
>>> of your attribute. It needs to have an initial value containing the
>>> object class and type.
>>>
>>>
>>>
>>> However, an SAP user is one of the easiest and most useful objects to
>>> implement as a class. I would suggest going with a ZCL_USER class
>>> instead. Much easier to work with.
>>>
>>>
>>>
>>> Cheers,
>>>
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
>>> Behalf Of Stevens, Seth
>>> Sent: 15 April 2009 21:42
>>> To: SAP Workflow Users' Group
>>> Subject: RE: Using BOR Object as Attribute In ABAP Class
>>>
>>>
>>>
>>> As a side note, same thing happens if I try to use an attribute of the
>>
>>> BOR in a binding.  Try to bind ZCL_MKT_TRADE . TRADER_BOR_OBJ . ZEMAIL
>>
>>> to a sendmail step.
>>>
>>>
>>>
>>> --Seth
>>>
>>>
>>>
>>> ________________________________
>>>
>>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
>>> Behalf Of Stevens, Seth
>>> Sent: Wednesday, April 15, 2009 3:26 PM
>>> To: SAP Workflow Users' Group
>>> Subject: Using BOR Object as Attribute In ABAP Class
>>>
>>> I am creating a custom workflow for our marketing group using ABAP
>>> Classes.  The main class I am dealing with is called ZCL_MKT_TRADE.
>>> We do not have HR implemented and subsequently use BOR object USR01
>>> for agent assignments in many custom workflows and have a lot of
>>> custom methods and attributes of use to this workflow.
>>>
>>> I need to use the trader (user) for several things in the workflow so
>>> I created an attribute on ZCL_MKT_TRADE called TRADER_BOR_OBJ that is
>>> of type BOR Object USR01 as outlined in Jocelyn's SDN BLOG.  I want to
>>
>>> use the trader for the agent assignment on a given workitem.  I use
>>> "Expression" and then select
>>> &ZCL_MKT_TRADE.TRADER_BOR_OBJ.NAMEWITHLEADINGUS& as the expression.
>>> This is available in the dropdown but when I choose it I get an error
>>> saying "NAMEWITHLEADINGUS is not a component of data object
>>> TRADER_BOR_OBJ".
>>>
>>> Is it not possible to accomplish what I am trying to do here?  I can
>>> always have the trader attribute on my class simply store the userid
>>> of the trader and then instantiate a separate USR01 BOR Object in my
>>> workflow container to host all the trader details; however, my first
>>> idea seems like better design.
>>>
>>> Thanks,
>>> Seth
>>>
>>>         <<
>>>                 ATT1922862.txt  (0.2KB)
>>>
>>>                 (0.2KB)
>>>          >>
>>>
>>>
>>>
>>> _______________________________________________
>>> SAP-WUG mailing list
>>> SAP-WUG at mit.edu
>>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>>
>>
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>





More information about the SAP-WUG mailing list