Start of Content Area

Procedure documentation Unit 11: Events and Their Creation  Locate the document in its SAP Library structure

Use

In this unit, you create the event delivery block cancelled.

Prerequisites

Events indicate the status changes of an object. Events always belong to an object and are therefore described as components in the object type definition.

Note

Keep in mind that when you create an event for an object type, this is only the first step. You still need to ensure that the event is actually triggered.

Procedure

  1. Position the cursor on the entry Events.
  2. Choose This graphic is explained in the accompanying text.
  3. Enter the following texts for the event to be created:
  4. Event: DelBlockCancelled
    Name:
    No delivery block
    Short description:
    Delivery block cancelled

    Caution

    Irrespective of whether you use uppercase and lowercase in the event name, the name is always entered in uppercase letters in the event receiver linkage table by the system.

  5. Choose This graphic is explained in the accompanying text.
  6. The event has now been created and is available in the Business Object Repository. You can now use this event in the other definition tools in SAP Business Workflow, it is displayed using the F4 input help.

  7. Position the cursor on the new event and choose Edit ® Change release status ® Object component To implemented.
  8. The object type must first be generated so that it can be instantiated and tested. Choose This graphic is explained in the accompanying text.

The system informs you if the object type still contains errors. Try to correct these errors in the error overview (Goto ® Error list).

Scenario for this event

The event DelBlockCancelled ( delivery block cancelled) states that an existing delivery block has been deleted.

The event can therefore be used as a terminating event of a task, in which the asynchronous method DeliveryBlockReset ( reset delivery block) is referenced. This method does not yet exist, but you could easily define it yourself as a copy of the method Edit . You must ensure that you define an asynchronous method.

At runtime, you can execute the task that encapsulates this method as often as you want and make changes to the sales order. Only when you really cancel the delivery block for your changes, is the event created and the task terminated.

Creating the event

This event can be created using a change document linkage referring to the field VBAK-FAKSK ( billing block in SD document).

In the table for assigning change documents to events, assign the change document object VERKBELEG to the object type Z_BUS2032 and to the event DelBlockCancelled .

Also enter a field restriction for this assignment, which states that the event is only to be created when a change is made to the field VBAK-LIFSK changing it from any value to the initial value.

For further information on creating events, see Wizards for Event Creation.