Events play a rather important role in Workflow. Triggering an event can start a workflow or task, or allow it to execute the next step in the flow. There are many main ways to create events,.
(1) From change documents
Change document are created/maintained by SAP on customized objects like purchase order data or material movement data. When it is switched on (thus when changes are logged) events can be triggered (created) where appropriate. Setting up event triggering (creation) from change documents can be done from Tools > Business Workflow > Development > Definition tools > Events > Event creation > Change documents.
Note: Creating an entry on the EKKO
table could imply the creation of a purchase order, or is it a contract ? Both contracts and purchase orders reside on the same table: EKKO
! Via Business Workflow > Development > Definition tools > Events > Event creation > Change documents > Linkage the type linkage for change documents can be set up. When double clicking on an entry, a screen is presented with the following possible additions in as function modules: Object Type, Event ID and Event Container. The "Object type" function module can be used to determine which object type should be triggered (E.g. BUS2012
for a purchase order and BUS2014
for a contract).
(2) Business Transaction Events Use transaction SWU_EWBTE
"Wizard: Business Transaction Events" to link your event triggering to business transaction events..
(3) Status management Use transaction BSVW
"Status management" to link your event triggering to the status of documents..
(4) Message control Use transaction NACE
"Message control" to link your event triggering to output control of documents (table NAST
and such).
(5) Directly via function module call
Where workflow events need to be created from e.g. An inbound Idoc, a direct call to FM SWE_EVENT_CREATE
is done. Note that some events need additional information, other than the business object key (say a purchase order number). Common additional data would be the Idoc number which is passed on as container element. Another used example would be the item number with confirmations. The following source-code extract shows a direct call to SWE_EVENT_CREATE
with container use:
See: Create an event from Abap coding
(6) From a workflow An event can also be created by a node in any workflow, which is set up much like a task.