SAP® Business Workflow Tutorial Triggering Events Programmatically By Suresh Kumar Parvathaneni Purpose: This document details the procedure in triggering the business object events programmatically. Pre-requisites: It is assumed that the reader of this document is aware of the business object concepts and good in ABAP. Procedure: In this document, we would take an example of the business object BUS1001006 (Material) and the event CREATED. In general, this event is triggered whenever a material is created using a standard procedure like MM01 or any others.
Calling another program from list in ABAP Sometimes we require to call another ABAP program from a current running ABAP program ( list ). Here we are going to check the available methods for that. Oct 18, 2016 - I tested that zobject and using this object created workflow to display product hierarchy,it is displaying it. In the abap program I am calling the funcion module, I.
Now we would trigger this event from our own programs. Following are the screenshots of the business object BUS1001006 and the event CREATED. Go to transaction SWO1 for more information of the business object. Double-clicking on the key field parameter gives you technical information of the field.
In order to trigger an event programmatically, we would use the function module SWEEVENTCREATE. Following is the sample code to trigger the events programmatically: REPORT ZDEMOTRIGGEREVENT. DATA: KEY LIKE SWEINSTCOU-OBJKEY. KEY = '1163'.
“ Material Number (hard-coded) CALL FUNCTION 'SWEEVENTCREATE' EXPORTING objtype = 'BUS1001006' objkey = KEY event = 'CREATED'. CREATOR = ' '. TAKEWORKITEMREQUESTER = ' '. STARTWITHDELAY = ' '. STARTRECFBSYNCHRON = ' '. NOCOMMITFORQUEUE = ' '. DEBUGFLAG = ' '.
NOLOGGING = ' '. IDENT =. IMPORTING. EVENTID =.
TABLES. EVENTCONTAINER = EXCEPTIONS OBJTYPENOTFOUND = 1 OTHERS = 2.
IF sy-subrc 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. WRITE 'Event Triggered'. In order to test whether the event is getting triggered or not, we can make use of Event Trace.
Switch on the event trace using the transaction SWELS. Press ‘Switch On”. Now execute the program developed earlier. Now switch-off the event trace using the same transaction SWELS.
Now go to transaction SWEL. Here you can list out the events triggered in the particular period of time.
Here is the event-trace list: Please send us your feedback/suggestions at. © 2006-2007 SAPTechnical.COM. All rights reserved. All product names are trademarks of their respective companies. SAPTechnical.COM is in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver, and and any other SAP trademarks are registered trademarks of SAP AG in Germany and in several other countries. Every effort is made to ensure content integrity. Use information on this site at your own risk.
Graphic Design.