Workitem ID

Kjetil Kilhavn KJETILK at statoil.com
Fri Jan 26 08:58:11 EST 2007


To get the current work item ID in a BOR object method, you can use the
following code (at least in 4.6C):

* Started from work item?
DATA: t_requester TYPE STANDARD TABLE OF swotobjid,
      l_workitem  TYPE swwwihead-wi_id.
FIELD-SYMBOLS: <requester> LIKE LINE OF t_requester.
 
CALL FUNCTION 'SWO_QUERY_REQUESTER'
     TABLES
          requester = t_requester
     EXCEPTIONS
          not_found = 1
          OTHERS    = 99.
IF syst-subrc = 0.
  LOOP AT t_requester
       ASSIGNING <requester>
       WHERE objtype = 'WORKITEM'.
    l_workitem = <requester>-objkey.
  ENDLOOP.
ENDIF.

If there is no value in l_workitem after this your object method is
being executed outside a work item.

However, aren't you more interested in the _previous_ work item?
-- 
Kjetil Kilhavn, Statoil OFT GBS BAS DEV SAP

 

> -----Original Message-----
> From: sap-wug-bounces at mit.edu 
> [mailto:sap-wug-bounces at mit.edu] On Behalf Of Mike Pokraka
> Sent: Friday, January 26, 2007 12:58 PM
> To: SAP Workflow Users' Group
> Subject: Re: Workitem ID
> 
> Hello Swathi,
> Why not bind _WORKITEM back to the WF into a container in 
> your WF. If it doesn't already have an attribute for 
> forwarded then you may have to create a delegated subtype, 
> but either way you have a far more flexible setup.
> Cheers,
> Mike
> 
> On Thu, January 25, 2007 3:08 pm, Swathi_Devireddy wrote:
> > Hi,
> > I have a situation where i need to check whether that partcular 
> > Workitem was executed by the Standard Option-Forward Workitem in my 
> > next Background step  in  Workflow.
> >
> > I checked the standard table SWIHEAD there is a field 
> WI_FORW_BY which 
> > contains a value if it WI was forwarded.
> > Problem is i am unable to retrieve the workitem ID .
> >
> > Design
> > Main workflow calls a subworkflow. In my subworkflow i have 
> my steps.
> > When i do binding of the Workitem ID it retrieves the first 
> Workitem 
> > ID in my subworkflow and not my Current Steps Workitem in Logs.
> > Any idea how to get the current workitem ID.
> >
> > Thanks & Regards
> > Swathi Devireddy
> > HCU-SAP
> > Satyam Computer Services Ltd
> > *    : +91 40 3065 2511
> > * : +91 98853 35301
> --
> Mike Pokraka
> Senior Consultant
> Workflow Connections
> Mobile: +44(0)7786 910855


-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.




More information about the SAP-WUG mailing list