Tutorial: Event Creation via Message Control


This tutorial explains flexible event creation from Message Control. You learn how you can create an event in order to respond to business conditions for which SAP has not provided a response mechanism. It is not necessary to make changes to the program code.

The subject is illustrated in a scenario which you set up in the individual units of this tutorial.

The tutorial highlights one aspect of the overall functionality of SAP Business Workflow. It cannot replace the complete documentation. The tutorial is designed for customers and consultants who want to extend the scenarios provided by SAP. The explanations and working methods are consciously covered in great depth; the fact that existing knowledge is repeated has been taken into account in this case.


SAP Business Workflow

In order to be able to work through this tutorial effectively, you should be familiar with the basic terms and concepts used in SAP Business Workflow and should have some practical experience. It is a definite advantage to have worked through the

Creating a Workflow Definition


This tutorial supplements the SAP Business Workflow documentation, which is also available online:

SAP Business Workflow

Message control

In order to work through this tutorial effectively, you should also be familiar with the basic terms and concepts used in Message Control. You will derive maximum benefit from this tutorial if you use the information described to enhance the Message Control you already have in operation.

The Message Control documentation is available online:

Message Control

Technical Requirements

The individual steps of this tutorial are performed automatically. The process is controlled by a workflow, which was defined to simplify Message Control customizing.

Before you work through the tutorial in the way described, make sure that SAP Business Workflow customizing has been completed in your system. The easiest way to do this is by calling the consistency checks for Customizing (transaction SWU3) and executing Automatic Customizing.

The automatic Customizing ensures, among other things, that the single step tasks that are used are marked as "general tasks" which you can consequently edit.

This step can be omitted if you already use SAP Business Workflow or if you have already been through the other tutorials successfully. You can also execute the automatic Customizing repeatedly, as existing settings are not overwritten.

Process Flow

A sales document (standard order) is created via the "normal" application functionality (Logistics ® Sales and distribution ® Sales, Order ® Create). The document is blocked in the business header data with the delivery block 02 (political reasons).

The creation of a sales document with the delivery block 02 is to be published by an event system-wide. Since the creation of this event is not provided in the standard version, this event is created via Message Control as a customer-specific enhancement.

The event is therefore available as a triggering event for tasks.

This tutorial only explains the creation of the event. The reaction to the event is not discussed in any greater detail.

Available application functionality

The scenario, as described above, requires that Message Control is used in the application concerned. This is the case in SD.

Tutorial structure

The following 10 points outline the tutorial and the entries which need to be made. If you are already familiar with SAP Business Workflow and Message Control, you will probably find these points sufficient.

Otherwise refer to the respective chapters. You can make the entries described in your IDES system.

Steps 3-9 are defined in the workflow definition for the workflow template WS00400040. You can therefore "leave it up to" the workflow to call the functionality. You can, of course, also use the transaction codes specified.

  1. Add the event DeliveryBlockSet (Delivery block set) to the definition of the object type BUS2032 (sales order).

    Step 1: Identifying and Extending Object Types

  2. Select the application V1 (sales) and start the workflow for customizing Message Control.

    Step 2: Choosing an Application and Starting the "Customizing-Workflow"

  3. Create the output type EVEN (Create event) with the partner-independent transmission medium 9 (Workflow event).

    (Application -> output type)

    Step 3: Maintaining the Output Type, transaction NACT

  4. Maintain the processing program RSWEMC01 with the FORM routine CREATE_EVENT for the output type EVEN and transmission medium 9.

    (Output type, transmission medium -> processing program)

    Step 4: Maintaining the Processing Program for the Message Type, transaction NACW

  5. Select the field Delivery block (LIFSK, delivery block document header) from the field catalog as the key for the condition table and generate the condition table.

    (Application -> condition table)

    Step 5: Creating a Condition Table, transaction NACQ

  6. Define an access sequence with access to the condition table created in step 5.

    (Application -> access sequence -> access to condition tables)

    Step 6: Creating an Access Sequence, transaction NACQ

  7. Assign the access sequence created in step 6 to the output type created in step 3.

    (Application, output type -> access sequence)

    Step 7: Assigning an Access Sequence to an Output Type, transaction NACS

  8. Specify that the value 02 (political reasons) in the field Delivery block is to trigger a message default for the output type EVEN with transmission medium 9 and dispatch time 4 (immediately).

    Enter the event DeliveryBlockSet and its object type BUS2032 in the communication data.

    (Application, output type -> field contents)

    Step 8: Maintaining Condition Records for Each Output Type, transaction NACR

  9. Include the created output type EVEN in the schema (procedure) V10000 (order output).

    (Application, schema (procedure) -> output type)

    Step 9: Maintaining the Output Type in the Schema, transaction NACZ

  10. Perform the scenario by creating a sales document and checking that the event has been created in the event log.

Performing the Scenario

The procedure described assumes that you are creating the condition components output type, condition table and access sequence from scratch.

However, you do not have to create all condition components from scratch. It may be the case with your own developments that you use condition tables and access sequences which already exist. If that is so, the order of the steps shown above does not need to be adhered to.

If you use an access sequence which already exists, the following steps are not necessary:

    • Step 6: It is not necessary to create an access sequence.
    • Step 7: The assignment between the output type and condition type is already defined in step 2.

For more information...