Page 1 of 1

Problem triggering the event in Loop using SWE_EVENT_CREATE

PostPosted: Wed May 16, 2012 10:59 am
by shrestharaju
We are triggering the event for BUS2032 WF using FM SWE_EVENT_CREATE.

For Sales Order with large number of line items, say our logic determined that for three material families, three WF event should be triggered for some approval.

The event gets triggered successfully for the first family, fails for the second and again triggers successfully for the third family.

Error Message: Source (expression '&_EVT_OBJECT.SALESDOCUMENT&') of binding assignment is not available

Strangely, this problem is only for Sales Order with large number of line items. For Sales Order with less number of line item, workflow events are getting triggered as expected.

We are calling the below FM in Loop. Any one faced this similar issue??
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'BUS2032'
objkey = v_object_key
event = 'OMPEVENT'
IMPORTING
event_id = v_eventid
receiver_count = v_eventid1
TABLES
event_container = lt_wf_cont
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2 .

Re: Problem triggering the event in Loop using SWE_EVENT_CREATE

PostPosted: Sat May 26, 2012 2:30 pm
by AspireWF
Hi.

After the FM call add below code,

If SY-SUBRC EQ 0.
COMMIT WORK.
ENDIF.

Your event will be fired correctly.

Regards,
AspireWF

Re: Problem triggering the event in Loop using SWE_EVENT_CREATE

PostPosted: Tue May 29, 2012 8:41 am
by shrestharaju
Thanks AspireWF..

There is already a COMMIT WORK in my code. The problem is only in case of Sales Order with large number of line items (around 300 lines). For rest all it is working fine.
Is it something related to system performance issue??