Updating an object attribute with the initiator of a workflow

Branco Marcina Branco_Marcina at national.com.au
Tue Apr 16 03:08:55 EDT 2002


Hi Workflow User Group,
I have a need to store the initiator of a workflow as an attribute of an
object.
I've successfully managed to get the initiator into the container for the
workflow
via the event.
 
I then want to create a step which is a task that calls a method to update
the
attribute of the object with the initiator of the workflow. I created the
Initiator as
an import parameter to the method and can successfully pass this to the
method.
 
My question is how do I best update the attribute of the object in the
workflow container with this value?
 
I've tried SWC_SET_ELEMENT with no success (too simplistic I think).
Do I need extra  import and export parameters on my method?
What macro call do I do to update the attribute of the object sitting in my
workflow container? Is there any program code I should be coding
against the virtual attribute for the object.
 
Below is a note posted by Jocelyn Dart  a while back which talks about the
method adding data to the object attribute, but didn't go into detail at
the time.
 
Any leads would be appreciated.
 
Regards,
Branco Marcina
Extension:  46117    (or 61 3 9322 6117 externally)
Building:   383 King Street, Melbourne, Australia
Floor / Desk:     6/124
Mobile:           0418 958 002
 
------------------------------------------------------------------------------------------------------------------
 
 
Hi Karen,
The BAPI BAPI_USER_GET_DETAIL will return the email address (tables
parameter ADDSMTP) of a user if the email address has
been maintained in their user master details. You can call this BAPI from
within a method or attribute.
 
I agree with Mark that it sounds like you might be approaching this from the
wrong angle.
If you can code the attribute directly against an object rather than passing
around data it's better
performance-wise (less overhead).
 
If you really need to pass a parameter, then you can't pass it directly to
an attribute, you need to
pass a parameter to a method which then sets up the attribute (this complies
with standard OO rules).
 
If you are passing userid, then make sure you aren't just passing the event
creator (i.e. the person
running the transaction when the event is created) as this is automatically
passed in standard event
parameter _EVT_CREATOR, which you can bind to your own container element or
to a standard
one, e.g. the workflow initiator, in the event-to-workflow binding. You
could then pass it on to your
task/method.
 
If you really need to pass in the userid yourself - and PLEASE!!! check the
other options first because
they are better for overall system performance and make better OO sense -
you may need to use
the macro swc_container_to_persistent before your call to SWE_EVENT_CREATE
to ensure the
userid is passed.
 
Regards,
 
Jocelyn Dart
Consultant (EBP, BBP, Ecommerce, Internet Transaction Server, Workflow)
SAP Australia
Email jocelyn.dart at sap.com
Tel: +61 412 390 267
Fax: +61 2 9935 4880
 
 
__________________________________________________________________________
The information contained in this email communication may be confidential.
You
should only read, disclose, re-transmit, copy, distribute, act in reliance
on or
commercialise the information if you are authorised to do so. If you are
not the
intended recipient of this email communication, please notify us
immediately by
email to NABpost at national.com.au or reply by email direct to the sender
and then destroy any electronic or paper copy of this message.  Any views
expressed in this email communication are those of the individual sender,
except
where the sender specifically states them to be the views of a member of
the
National Australia Bank Group of companies.  The National Australia Bank
Group
of companies does not represent, warrant or guarantee that the integrity of
this
communication has been maintained nor that the communication is free of
errors,
virus or interference.
 


More information about the SAP-WUG mailing list