Event Creation 

Use

Events are created when the relevant status change occurs. The event creation must be implemented by SAP or yourself, or catered for by appropriate table settings.

Usually, the event creation is implemented in the application programs for the events supplied by SAP.

Customer-specific events

You can also create additional events yourself for specific status changes, which are not provided by SAP in the standard version. The creation of these events is catered for by table settings.

Features

When an event is triggered, the workflow system checks the event receiver linkage table to see whether receivers are entered for this event. If any are found, these receivers are called using the function module also located in the linkage table.

There are various ways in which events can be created:

Function module

Event creation by calling function module SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT .

An event can be created from any program by calling the function module SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT . Knowledge and experience of the programming environment are required.

The ID of the event, the ID of the triggering object type and the object type-specific key are passed to this function module as import parameters, and the event container as a table parameter.

For further information, refer to Creation of Events by Calling a Function Module .

Change documents

Event creation when change documents are written

You can set the following system behavior by making entries in the relevant control tables of change document management:

Status changes of objects which are logged as change documents are reported automatically as events as well.

For further information, refer to Creation of Events When Change Documents Are Written .

General status management

Event creation upon status changes

You can set the following system behavior by making entries in the relevant control tables of status management:

The system automatically creates an event for objects that use general status management when an object status changes.

For further information, refer to Creation of Events Upon Status Changes .

Message control

Event creation as message type

Events can be created via a connection to Message Control.

For further information, refer to Creation of Events via Message Control .

Logistics Information System (LIS)

Event creation when an exception situation occurs (LIS exception)

The occurrence of an exception situation defined within the LIS as an exception is to cause an event to be created.

For further information, refer to Creation of Events Upon LIS Exceptions .

Business Transaction Events

For further information, refer to Creation of Events via Business Transaction Events .

HR master data

Event creation when HR master data changes

To create events when HR master records change, you must carry out the following Personnel Management Customizing activities:

These Customizing activities can be found in the SAP Reference IMG under Personnel Management ® Global Settings in Personnel Management ® Business Workflow Events.

Activities

You can use a wizard for the creation of certain events.

If you cannot use a wizard, you must adhere to the following procedure when creating customer-specific events:

  1. Define the event that you want to create as a component of an object type which you have created in the customer namespace.
  2. Usually you create this object type as a subtype of an object type supplied by SAP. This extends the functionality inherited from the supertype. But you can also create your own object type in the Business Object Repository without using inheritance from a supertype.

    This procedure is necessary because customer-specific events cannot be defined for object types supplied by SAP. These object types have program character and you cannot change them.

    For further information on creating an object type as a subtype, refer to Creating Object Types .

  3. Make this subtype into a delegation type of the initial object type.
  4. For further information, refer to Adapting Object Types on a Customer-Specific Basis.

  5. Maintain the relevant table settings to create your event.

For further information, refer to Tutorial: Event Creation Upon Status Changes.