Show TOC

Procedure documentationUnit 11: Events and Their Creation Locate this document in the navigation structure

 

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 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.

End of the note.

Procedure

  1. Position the cursor on the entry Events.

  2. Choose .

  3. Enter the following texts for the event to be created:

    • Event: DelBlockCancelled

    • Name: No delivery block

    • Short text: Delivery block canceled

    Caution 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.

    End of the caution.
  4. Choose .

    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.

  5. Position the cursor on the new event and choose   Edit   Change Release Status   Object Component   To Be Implemented  .

  6. The object type must first be generated so that it can be instantiated and tested. Choose .

    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 canceled) 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 more information on creating events, see Wizards for Event Creation.