Vous êtes sur la page 1sur 3

EVENTS IN SAP ABAP: 1. INITIALIZATION: Occurs when report initialized.

This events is triggered first if users executes an abap report. 2. AT SELECTION-SCREEN OUTPUT : This event is triggered when the selection screen loaded in the memory before being displayed. Occurs each time selection screen about to generated. We can use it to modify selection screen, for example hide / unhide parameter. 3. AT SELECTION-SCREEN. Occurs each user command in selection screen. we can use it to perform checking on user input. This event is triggred before leaving the selection screen. 4. START-OF-SELECTION Occurs after the standard selection screen has been processed., data is read in this event. This is the first and default event for displaying the report.Data retrieval logic is written under this event. 5. TOP-OF-PAGE This event is triggered everytime a new page is started in the list. Occurs when a new page starts. Use it for write report header. 6. END-OF-PAGE This event is triggered everytime the list data reaches the footer region of the page. Occurs when a page ends. Use it for write report footer.

7. END-OF-SELECTION This event is triggered after start-of-selection is completed. Occurs after start-of-selection.

8. AT LINE-SELECTION Occurs when the user double-click on report. 9. AT USER-COMMAND Occurs when the user push toolbar button. 10. AT PF <KEY> Function key from F5 to F12, to perform interactive action on the list.

This is program to demonstrate how to use event properly. REPORT ZAALGAL0008 LINE-COUNT 10(1). *http://abap-gallery.blogspot.com TABLES: sflight. DATA: BEGIN OF t_report OCCURS 3, carrid LIKE sflight-carrid, connid LIKE sflight-connid, END OF t_report. *begin selection screen PARAMETERS p_datum LIKE sy-datum. PARAMETERS p_check AS CHECKBOX. *end selection screen INITIALIZATION. *begin initialization MOVE sy-datum TO p_datum. *end initialization AT SELECTION-SCREEN. *begin at selection-screen MESSAGE I888(sabapdocu) WITH 'At selection-screen'. IF p_check = 'X'. MESSAGE E888(sabapdocu) WITH 'Clear checkbox'. ENDIF. *end at selection-screen AT SELECTION-SCREEN OUTPUT. *begin at selection-screen output

MESSAGE I888(sabapdocu) WITH 'At selection-screen output'. *end at selection-screen output START-OF-SELECTION. *begin start-of-selection. MESSAGE I888(sabapdocu) WITH 'start-of-selection'. SELECT * FROM sflight. MOVE sflight-carrid TO t_report-carrid. MOVE sflight-connid TO t_report-connid. APPEND t_report. ENDSELECT. *end start-of-selection. END-OF-SELECTION. *begin end-of-selection. MESSAGE I888(sabapdocu) WITH 'end-of-selection'. FORMAT COLOR col_normal. DO 30 TIMES. LOOP AT t_report. WRITE / t_report-carrid. WRITE t_report-connid. ENDLOOP. ENDDO. *end end-of-selection. TOP-OF-PAGE. FORMAT COLOR col_heading. WRITE 'This is header'. END-OF-PAGE. FORMAT COLOR col_total. WRITE 'This is footer'. AT LINE-SELECTION. WRITE: / 'Cursor Row:', sy-curow. WRITE: / 'Cursor Col:', sy-cucol.

Vous aimerez peut-être aussi