Unit 11: Events and Their Creation
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.
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
Event:
DelBlockCancelledIrrespective 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.
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.
The system informs you if the object type still contains errors. Try to correct these errors in the error overview (Goto
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.