About 5 months ago I posted asking how to raise an event for an asynchronous task that creates a document. I had some great replies, but now I am actually implementing this for the first time using the finction module SWE_EVENT_CREATE_FOR_UPD_TASK.
I have a problem in that I seem to be unable to get the instance linkage correctly populated with the object key; it is always empty.
In my workflow, I have a new object ZWGBU2032 subclassed from BUS2032. This is in an asynchronous task and the terminating event is bound such that the container element WIOBJECT_ID is object type ZWGBU2032 and event CREATED. The binding is from &_EVT_OBJECT to &_WI_OBJECT_ID.
In the sales order save user exit, I am calling my own function module in the V2 task:
CALL FUNCTION 'ZWG_EVENT_ZWGBU2032_CREATED' IN UPDATE TASK EXPORTING VBELN = VBAK-VBELN.
This function module then invokes in its body:
L_OBJECT_KEY = VBELN. CALL FUNCTION 'SWE_EVENT_CREATE_FOR_UPD_TASK' EXPORTING objtype = 'ZWGBU2032' objkey = L_OBJECT_KEY event = 'CREATED' * CREATOR = ' ' START_WITH_DELAY = 'X' TAKE_WORKITEM_REQUESTER = 'X' tables event_container = container_instanz EXCEPTIONS OBJTYPE_NOT_FOUND = 1 OTHERS = 2.
I have checked that the object key has a value when debugging the update task, but the instance linkage never receives it.
Can anybody please tell me why this may be so?