Updating an object attribute with the initiator of a workflow

Samir Gujar samirg at novasoftinfo.com
Tue Apr 16 06:36:53 EDT 2002


Hello,
 
   I donot know about the exact requirement and whether the initiator is
required as an attribute of the object. But I am suggesting this as a
solution to updated a virtual attribute of the object.
 
My idea is based on 2 things, use of SPA/GPA IDs and Macro
SWC_REFRESH_OBJECT(since this initiates recalculation of all virtual
attributes).
 
This is an example I used to test it.
 
I created a virtual attribute for my object. - werks.
And a SPA/GPA parameter - zwerks.
 
In the coding part of this virtual attribute I used following statements
  GET PARAMETER ID 'ZWERKS' FIELD object-werks.
  SWC_SET_ELEMENT CONTAINER 'werks' OBJECT-WERKS.
 
I created a new method to change this attribute
And its coding is as follows
Where werks is one of the parameter of the method.
set parameter id 'ZWERKS' field werks.
SWC_REFRESH_OBJECT SELF.
 
 
When u call this method, after the method execution, all the virtual
attributes are recalculated and thus the werks attributes is updated with
this new value.
 
I think you can try the same for changing the initiator value of your
object.
 
Regards,
Samir.
 
 
-----Original Message-----
From: Dart, Jocelyn
To: SAP-WUG at MITVMA.MIT.EDU
Sent: 4/16/02 5:31 AM
Subject: Re: Updating an object attribute with the initiator of a
workflow
 
Hi Branco,
 
I agree with Stephan's comments but I think your approach may need
rethinking overall.
 
The whole thing hinges around WHY you want to store the initiator of the
workflow.
 
If it's just so you can pass it around the workflow there is absolutely
no
need
- events, binding and container operations will let you do this without
creating an object
attribute.
 
If you actually want to store the initiator of the workflow for later
reporting,
then creating it as an object attribute is not enough.  Either:
 
* You actually need to store it somewhere on the database, e.g. in a
custom
table, in which case yes you could use a method to do this and binding
to
pass
the workflow initiator to your method, OR
 
* You should just use the workflow WAPIs to extract this information
when
you
create the report
 
Suggest you rethink.
 
Regards,
        Jocelyn Dart
Consultant (EBP, BBP, Ecommerce, Internet Transaction Server, Workflow)
SAP Australia
Email jocelyn.dart at sap.com <mailto:jocelyn.dart at sap.com>
Tel: +61 412 390 267
Fax: +61 2 9935 4880
 
 
 
-----Original Message-----
From: Branco Marcina [mailto:Branco_Marcina at national.com.au]
Sent: Tuesday, 16 April 2002 5:09 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Updating an object attribute with the initiator of a workflow
 
 
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