Wednesday, April 25, 2012

ABAP Flow of Events :

1. Load Of Program : When a program is called using SUBMIT or using a transaction code, then – at every call – a new internal session is opened and the event block is executed once at every call. You can initialize global data objects of the program here. The event block must be executed completely; otherwise, a runtime error will occur.Therefore, no statements are allowed to be executed that leave the event block without returning.At the first call of an external Procedure (sub-program or function module), the framework program of the called procedure is loaded into the internal session of the caller, thus triggering the event LOAD-OF-PROGRAM.

2. Initialization : This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen.

3. At Selection Screen :  The event keyword AT SELECTION-SCREEN provides you with several possibilities to carry out processing blocks while the system is processing the selection screen. To react on different events, that can occur when the selection screen is processed, the keyword AT SELECTION-SCREEN has various options. All the Validation Done on Selection Screen is done through this event. The AT SELECTION SCREEN event is triggered after the user enters value on the selection screen and presses enter or Executes it.

4. Start Of Selection : Start Of Selection is triggered after the selection screen is processed. In an executable program, all statements that are not declarations and that are listed before the first explicit processing block, or if the program does not contain any explicit processing blocks, then all functional statements of the program, are assigned to an implicit event block START-OF-SELECTION, which is inserted before any START-OF-SELECTION event blocks.If the program is linked to a logical database, preparatory tasks can be performed at START-OF-SELECTION before the logical database imports the data.

5. End Of Selection : END-OF-SELECTION is the last system event to be processed during the runtime of a report program.  It occurs after all logical database records have been read, and before any user-invoked events. END-OF-SELECTION occurs only once.

6. Top Of Page : TOP-OF-PAGE is used for page headers on the basic list only. TOP-OF-PAGE is triggered when the system encounters a WRITE, SKIP, or ULINE statement on the basic list. TOP-OF-PAGE occurs the moment the first line of the first page is written to the screen. NEW-PAGE also invokes the TOP-OF-PAGE event. This occurs when a new page is started – that is, immediately before the first line in a new page is to be output.

7. End Of Page : The END-OF-PAGE event is used for page footers. This event is triggered when the system encounters insufficient space on the current output page.  The LINE-COUNT statement within the REPORT statement specifies the size of the page area.  If a LINE-COUNT is not explicitly coded, the END-OF-PAGE event block will not be processed. So the LINE-COUNT is defined like this if the page contains 50 lines and 3 lines are for the footer then it should be written as LINE-COUNT 50(3).

8 At Line Selection : This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list – provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.

9. At User Command : This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.

10. At PFn : This statemet defines an event block whose event is triggered by the ABAP runtime environment during list display – provided the screen cursor is on a list line and a function is selected using the function code PFn. Here n stands for a number between 01 and 24. In the= standard list status, these function codes are assigned to the function keys of the input device.

2 comments:

  1. Can anyone provide me "one simple report program using all events in sap abap"?

    ReplyDelete
  2. The information provided here is of great use as I got to learn new things. Keep blogging.
    SAP ABAP TRAINING IN HYDERABAD

    ReplyDelete