I have a program that collect severals Purchase Orders numbers into a internal table and launch, in a "loop at table" command, the event BUS2012.ReleaseStepCreate for each order in this loop.
The function module SWE_EVENT_CREATE is used to start de WF.
The problem is that sometimes the Workflow is not started for some items in the internal table.
Example: for a set of 10 purchase order numbers, only 3 is launched, the others not. In another time, all 20 items, in a set of 20, is launched correctly. In another moment, only 7 is launched, in a set of 8, and so on.
The logic is following:
Loop at table01.
zobject = 'BUS2012'.
zobjkey = table01-ebeln.
zevent = 'releaseStepCreated'.
CLEAR zapplicant.
zapplicant-otype = 'US'.
zapplicant-objid = sy-uname.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = zobject
objkey = zobjkey
event = zevent
creator = zapplicant
* TAKE_WORKITEM_REQUESTER = ' '
* start_with_delay = ' '
start_recfb_synchron = 'X'
NO_COMMIT_FOR_QUEUE = ' '
* DEBUG_FLAG = ' '
* NO_LOGGING = ' '
* IDENT =
IMPORTING
event_id = zeventid
* TABLES
* EVENT_CONTAINER = ZCONTAINER
EXCEPTIONS
objtype_not_found = 01.
* OTHERS = 2
COMMIT WORK.
ZRESULT = sy-subrc.
Endloop.
Does anyone knows what can be happening ?
Thanks

