Triggering a workflow from a function module
Hans Brilleman
Hans.Brilleman at capetown.gov.za
Mon Jan 20 04:59:49 EST 2003
Hi Richard,
Yes, the requestor does have the correct authorizations.
You say that the _EVT_RECEIVER_ID is normally populated when a
terminating event is published. How will that fall in place with me
creating an event for my workflow to trigger? I am not sure where or how
the terminating event fits in the picture.
Could you possible shed some more light on this?
Much appreciated.
Thanks,
Hans.
>>> rvmarut at earthlink.net 01/18/03 11:17pm >>>
Hans,
_EVT_RECEIVER_ID is intended to hold a work item id and is normally
populated when a terminating event is published.
Does the person staring the workflow (requestor) have the correct
authorizations?
Your code looks fine and should work. To get the requestor of the
workflow, I have included _EVT_CREATOR in the event binding to the
WF_INITIATOR element.
Richard Marut
The Consulting Highway, Inc
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
Hans Brilleman
Sent: Saturday, January 18, 2003 7:57 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Triggering a workflow from a function module
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