sapdev logo background
sapdev logo sapdev logo
Comments

SAP EVENT BLOCKS documentation, setup help and example usage



Return to SAP documentation index


Article

Event Blocks
Event blocks are used to handle events in the ABAP runtime environment. They are introduced by an event key word and finished by the next processing block. Since there is no closing statement, we recommend that you flag the end of an event block with a comment line.
Within an event block, no local data types or data objects can be declared. All declarative statements in event blocks belong to the ABAP program, and are visible in all subsequent processing blocks. An event block works with the global data types and data objects of the framework program , and therefore should not contain any of its own declarations. Exception: The event blocks AT SELECTION-SCREEN ... and GET ... are implemented internally as procedures and can contain local data).
For reasons of data encapsulation, it is advisable to only implement a few functions in event blocks, and to call methods instead.
The following events exist:
  • Program constructor event

  • This event occurs in all program types , except for class pools and interface pools.
  • Reporting Events

  • These events only occur in executable programs .
  • Selection screen and list events occur during selection screen processing

  • or list processing .
    ABAP_PGL No implementations in dialog modules and event blocks

    Notes
  • When the execution of each event block is completed, the statement NEW-LINE is executed.

  • With the exception of AT SELECTION-SCREEN ... and GET ...

  • event blocks can be listed multiple times in a program. Event block START-OF-SELECTION can also be implicitly listed multiple times. Whenever an event occurs, all associated event blocks are executed in the order of their occurrence. Where event blocks are implicitly listed multiple times, the extended program check posts a warning.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    EVENTS_OVERVIEW
    EVENT_BLOCK_GLOSRY




    comments powered by Disqus