Start of Content Area

Function documentation Creation of Event Handlers  Locate the document in its SAP Library structure

Use

You use event handlers to track and evaluate objects or processes that you have determined as being relevant to supply chain event management.

Event handlers are created in SAP Event Management in various ways:

      The application interface creates event handlers for application objects.

      Sending an event message creates an event handler.

      The application system calls a Business Application Programming Interface (BAPI). This triggers the creation of an event handler in SAP Event Management.

To check how event messages are processed for an event handler, the system requires the expected events and the rule set that belong to the event handler, as defined in Customizing in SAP Event Management.

Note

If you test functions in SAP Event Management purely for test purposes and do not want to set up a corresponding application system, you can use transaction /SAP/TRX/EH_CREATE.

For more information about manually creating event handlers for test purposes, see SAP Service Marketplace at http://service.sap.com/scm ® Supply Chain Event Management ® Detailed Information.

Integration

Depending on the objects that you want to track and the partners who are involved, you can create different event handlers using the application interface.

Example

For example, you can specify the expected events according to the quality of the supplier. The event handler for an unreliable supplier has a more extensive list of expected events that must be reported than the event handler for a reliable supplier (see also Event Message Processing).

Communicating Data to Create Event Handlers

The following data is transferred from the application system to SAP Event Management via the application interface to create an event handler:

      Main identification of the application object (application system, application object type, and application object ID)

      Parameter record:

       Control parameters

       Tracking IDs

       Info parameters

       Expected events

       Query IDs

       Measurement data

Prerequisites

      You have specified the following in the application system:

       The application object types

       The condition for determining the application object type

       The function for determining expected events

       The control, system, and info parameters (see Parameters)

      You have defined the following in SAP Event Management:

       The event handler types

       The condition for determining the event handler type

       The expected event profile

       The parameter profile

       The status attribute profile

       The rule set

      You have set up Customizing for the application interface and have installed the corresponding visibility process in the application system or have defined your own process. The visibility process allows you to connect to your business objects in the application system.

      You have set up the RFC connections that create the link between the application system and SAP Event Management.

      You have defined the following for creating an event handler using an event message:

       The criteria

       The plug-in function modules

For more information about defining criteria and plug-in function modules, see Customizing for SAP Event Management under Event Messages, Status Queries, and Web Interface ® Define Criteria for Event Message Processing.

Activities

The event handler creation process begins as soon as you save a document in the application system.

The steps for creating an event handler are shared between the application system and SAP Event Management.

...

       1.      You save your document in the application system.

       2.      The application system executes the following:

...

                            a.      It extracts the data container of the business object so that SAP Event Management can create an event handler with the corresponding event handler type.

                            b.      It determines which SAP Event Management system is responsible for the application object type. (An application system can work with several SAP Event Management systems simultaneously.)

                            c.      It specifies the business process type (BPT) of the business object.

                            d.      It retrieves the application object types for the BPT from the application system and determines if they are relevant to supply chain event management (SCEM-relevant).

                            e.      It creates control parameters for all application objects that are SCEM-relevant.

                              f.      It checks whether SAP Event Management can create one or more event handlers.

       3.      SAP Event Management executes the following:

...

                            a.      It standardizes the control parameters that have been sent from the application system so that it can process them.

                            b.      It checks if suitable event handlers already exist.

If it does not find any suitable event handlers, it continues to execute the checks for generating an event handler.

If it finds a suitable event handler, it uses this and updates the event handler.

                            c.      It checks if it can generate the event handler.

                            d.      It sends the result of the check to the application system.

       4.      The application system continues to process the confirmed application objects.

       5.      The application system then executes the following:

...

                            a.      It collects all data from the parameter containers (control and info parameters, expected events, tracking IDs, query IDs, business object keys).

                            b.      It sends the marker for sending the collected data to SAP Event Management. (The application system does not send the data until it continues with the saving process. See also: step 5e)

                            c.      It marks open communication processes for a status update in the status table. (The application system does not update the status until it continues with the saving process. See also: step 5e)

                            d.      It flags the application log for an update. (The application system does not update the application log until it continues with the saving process. See step 5e)

                            e.      It returns to saving the business object. All actions that have been marked for execution are completed in the application system.

       6.      At the same time, SAP Event Management determines the event handler type and creates an event handler with the relevant expected events and status attributes. To do so, SAP Event Management executes the following:

       It standardizes the data from the application system parameter containers (see step 5a) so that it can process it.

       It calls the activities for updating processes.

       It sends the confirmation for completed transactions to the application system.

Creating an Event Handler Using an Event Message

      The event handler creation process begins as soon as you send an event message to SAP Event Management. For this to occur, the event message must meet the predefined criteria.

      The plug-in function module creates an event handler and SAP Event Management processes the event message.

You specify the following data in the event message so that the plug-in function module can create the event handler:

      The application system

      The application object type

      The control parameters

      The info parameters

      The tracking IDs

      The milestone data for the expected events from the event message

 

 

End of Content Area