Classical Report Events

                                                      Report Events
Below are the list of Report Events. In ABAP, every event have importance.

  • Load-of-program
  • Initialization
  • At Selection-Screen output
  • At Selection-Screen on field
  • At Selection-Screen on value request
  • At Selection-Screen on help request
  • At Selection-Screen
  • Start-of-Selection
  • End-of-Selection
  • Top-of-Page
  • End-of-Page

LOAD-OF-PROGRAM:

This is the first event in execution sequence. This event loads the program into memory for execution.

All Data Declarations, Type Declarations will execute in this event only.

INITIALIZIATON:

This event is used to initialize variables, Screen values and other default actions.

We can provide default values to the selection screen which includes calculations.

We can provide default values in the declaration statement also. But we cannot perform default values with calculations here.

Example :

SELECT-OPTIONS: s_date for sy-datum.

INITIALIZATION.
s_date-sign = ‘I’.
s_date-option = ‘EQ’.
s_date-low = sy-datum – 30.
s_date-high = sy-datum.
APPEND s_date.

AT SELECTION-SCREEN OUTPUT:

By using this event we can manipulate dynamic selection-screen changes.

This event triggers at the screen event PBO of the selection screen.

EXAMPLE :

 

REPORT ZBP_CLASSICAL_EVENTS.

PARAMETERS P_ENABLE AS CHECKBOX USER-COMMAND UC1.
PARAMETERS: INPUT(5) TYPE C MODIF ID IN1 . “Based on modif id we will perform dynamic operations

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
IF P_ENABLE = ‘X’  . ” If check box is selected
IF SCREEN-GROUP1 = ‘IN1’ .
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ELSE.
IF SCREEN-GROUP1 = ‘IN1’ .
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.

AT SELECTION-SCREEN ON FIELD :

This event is used to validate a single selection-screen input parameter.

At Selection-Screen on <selection screen Field name>.

It will validate this particular field first.

AT SELECTION-SCREEN ON VALUE REQUEST :

This event is used to provide value help ( field help ) for a input field.

At Selection-Screen on Value request for <Selection Screen Field Name>

It will provide F4 Help.

AT SELECTION-SCREEN ON HELP REQUEST :

By using this event we can provide F1 help for a input field.

At Selection-Screen on Help request for <Selection Screen Field Name>

AT SELECTION-SCREEN :

This event is used to validate multiple input fields.

START-OF-SELECTION :

This is default event which is used to write actual business logic .

END-OF-SELECTION :

We can use this event just to state that start-of-selection is ended, this event is used with logical databases, logical databases are in HR ABAP only. In normal ABAP we don`t have much importance .

TOP-OF-PAGE :

This event prints constant heading for all pages.

END-OF-PAGE :

This event prints constant footer for all pages.

Before using this event, we need to reserve some lines for displaying footer .

REPORT ZBP_PROG LINE-COUNT 34(2).

It will reserve 2 lines space for end-of-page.

 


-> Next Post

Leave a Reply