Triggering a workflow from a function module
Hans Brilleman
Hans.Brilleman at capetown.gov.za
Sat Jan 18 08:56:56 EST 2003
Hi,
I am trying to trigger a workflow from a function module. The building
of the container elements seems fine, but the triggering of the event
using SWE_EVENT_CREATE is not so succesfull. It gives an inconsistent
error regarding the requester. If I then export a value of X in the
field take_workitem_requester, it is happy (which I do not understand as
it seems that generally it defaults with a space and is not a mandatory
field for passing a specific value). BUT - now receiverid (or RECID)
stating that it is invalid. I have tried for testing purposes to
populate the container element _EVT_RECEIVER_ID with a value of
WF-BATCH. It worked for a while, but now all of a sudden it does not
anymore and gives the error again. Could anybody give me a idea of what
the purpose of this element is, and what the values are that the event
creation requires.
Below see a extract of my program code.
SWC_CREATE_OBJECT INSTLN 'INSTLN' Z_ANLAGE.
SWC_SET_ELEMENT CONTAINER 'instln' INSTLN.
SWC_SET_ELEMENT CONTAINER 'CSRID' SY-UNAME.
SWC_SET_ELEMENT CONTAINER 'MoveOutDoc' Z_MOVEOUT_DOCUMENT.
SWC_SET_ELEMENT CONTAINER '_EVT_RECEIVER_ID' 'WF-BATCH'.
objtype = 'MOVEOUTDOC'.
objkey = Z_MOVEOUT_DOCUMENT.
event = 'MODisconnect'.
call function 'SWE_EVENT_CREATE'
EXPORTING
objtype = objtype
objkey = objkey
event = event
take_workitem_requester = 'X'
TABLES
event_container = CONTAINER
EXCEPTIONS
objtype_not_found = 1
others = 2.
Thanks,
Hans Brilleman
More information about the SAP-WUG
mailing list