This website is not affiliated with, sponsored by, or approved by SAP AG.

Problem triggering the event in Loop using SWE_EVENT_CREATE

Business WorkFlow

Moderators: Snowy, thx4allthefish

Problem triggering the event in Loop using SWE_EVENT_CREATE

Postby shrestharaju » Wed May 16, 2012 10:59 am

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 .
shrestharaju
 
Posts: 4
Joined: Wed Jan 12, 2011 9:31 am

Re: Problem triggering the event in Loop using SWE_EVENT_CREATE

Postby AspireWF » Sat May 26, 2012 2:30 pm

Hi.

After the FM call add below code,

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

Your event will be fired correctly.

Regards,
AspireWF
AspireWF
 
Posts: 2
Joined: Sat May 26, 2012 2:17 pm

Re: Problem triggering the event in Loop using SWE_EVENT_CREATE

Postby shrestharaju » Tue May 29, 2012 8:41 am

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??
shrestharaju
 
Posts: 4
Joined: Wed Jan 12, 2011 9:31 am


Return to Business WorkFlow

Who is online

Users browsing this forum: No registered users and 0 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.