You are on page 1of 23

IBM Global Services

ABAP Events

ABAP Events | 4.02

March-2005

© 2005 IBM Corporation

IBM Global Services

Objectives
 The participants will be able to:
 Interpret ABAP Event-Driven Programming.

 Identify the System Triggered events that are executed during runtime of a Report program
 Identify the User Invoked List Display events, that are triggered after the report has generated the basic list.

2

ABAP Events | 4.02

March-2005

© 2005 IBM Corporation

WRITE: / ‘START-OFSELECTION’. WRITE: / ‘END-OF-SELECTION’. Program Flow List Produced TABLES: BSIK. DATA: VAR1(4) VALUE ‘0001’. IF SY-LINNO < 5. ‘has occurred’.IBM Global Services ABAP Event-Driven Programming Program Code REPORT ZPB001. 3 ABAP Events | 4. WRITE: / BSIK-LIFNR. GET BSIK. ‘has occurred’. START-OF-SELECTION. VAR1. ENDIF.02 Program Header 2 3 1 START-OF-SELECTION has occurred 100000 0001 END-OF-SELECTION has occurred March-2005 © 2005 IBM Corporation . END-OF-SELECTION.

IBM Global Services Runtime Event : INITIALIZATION Execute a processing block before the selection screen 4 ABAP Events | 4.02 March-2005 © 2005 IBM Corporation .

02 March-2005 © 2005 IBM Corporation .IBM Global Services Runtime Event : AT SELECTION-SCREEN Trigger a function code on the selection screen 5 ABAP Events | 4.

02 March-2005 © 2005 IBM Corporation .IBM Global Services Runtime Event: START-OF-SELECTION Can be coded explicitly. 6 ABAP Events | 4. but need not be.

02 March-2005 © 2005 IBM Corporation .IBM Global Services Runtime Events : GET and GET LATE Select records from logical database tables 7 ABAP Events | 4.

02 March-2005 © 2005 IBM Corporation . Occurs only once 8 ABAP Events | 4.IBM Global Services Runtime Event : END-OF-SELECTION Last system event to occur.

02 March-2005 © 2005 IBM Corporation .IBM Global Services Output Event : TOP-OF-PAGE Used for page headers for the basic list only 9 ABAP Events | 4.

IBM Global Services Output Event : TOP-OF-PAGE DURING LINE-SELECTION Used for page headers on detail lists 10 ABAP Events | 4.02 March-2005 © 2005 IBM Corporation .

IBM Global Services Output Event : END-OF-PAGE Used for page footers 11 ABAP Events | 4.02 March-2005 © 2005 IBM Corporation .

02 March-2005 © 2005 IBM Corporation .  INITIALIZATION.  AT SELECTION-SCREEN.  GET <table>.IBM Global Services Demonstration  Observe the following system-triggered events during execution of a Report program.  END-OF-SELECTION.  END-OF-PAGE.  TOP-OF-PAGE. 12 ABAP Events | 4.  START-OF-SELECTION.  GET <table> LATE.

02 March-2005 © 2005 IBM Corporation .  END-OF-SELECTION.  GET <table> LATE.  AT SELECTION-SCREEN.IBM Global Services Practice  Observe the following system-triggered events during execution of a Report program. 13 ABAP Events | 4.  START-OF-SELECTION.  END-OF-PAGE.  INITIALIZATION.  GET <table>.  TOP-OF-PAGE.

02 March-2005 © 2005 IBM Corporation .IBM Global Services List Display (User) Events Order of execution determined by user 14 ABAP Events | 4.

02 March-2005 © 2005 IBM Corporation .IBM Global Services List Display Event : AT PF## Triggered by function code PF## 15 ABAP Events | 4.

02 March-2005 © 2005 IBM Corporation .IBM Global Services List Display Event : AT LINE-SELECTION Triggered by function code PICK 16 ABAP Events | 4.

02 March-2005 © 2005 IBM Corporation .IBM Global Services List Display Event : AT USER-COMMAND Triggered by function code All Others besides PICK or PF## 17 ABAP Events | 4.

 AT PF##.  AT LINE-SELECTION.  AT USER-COMMAND.IBM Global Services Demonstration  Observe the following user-invoked List Display events after the Basic List has been generated by a Report Program. 18 ABAP Events | 4.02 March-2005 © 2005 IBM Corporation .

 AT PF##.02 March-2005 © 2005 IBM Corporation .  AT USER-COMMAND.IBM Global Services Practice  Observe the following user-invoked List Display events after the Basic List has been generated by a Report Program.  AT LINE-SELECTION. 19 ABAP Events | 4.

IBM Global Services List Display Events (“User” Events) .Typical Usage Event Triggered by Typical User Function Code AT PF## PF## Action Assigned Function key pressed AT LINE-SELECTION PICK Mouse double-click.button.02 March-2005 © 2005 IBM Corporation . or select a menu item 20 ABAP Events | 4. Or single click + F2 AT USER-COMMAND ALL OTHER CODES Click on a push.

02 March-2005 © 2005 IBM Corporation .IBM Global Services When Is a List Displayed? 21 ABAP Events | 4.

IBM Global Services Summary  Flow of an ABAP program is controlled by events. It occurs only once during the execution of an ABAP program. 22 ABAP Events | 4. are part of the event START-OF-SELECTION. AT LINE-SELECTION (when the user double-clicks on a line) and AT USER-COMMAND (Clicking on a pushbutton or selecting a menu item) are three different user-invoked events that are handled from an ABAP program. Execution order of events does not depend on the order in which they are coded in the program.  AT PF## (when any Function key is pressed).  All ABAP statements that are not coded as part of an event.  END-OF-SELECTION is the last system triggered event to be processed during the runtime of a program. It gets triggered automatically. This event does not need to be coded explicitly in an ABAP program.02 March-2005 © 2005 IBM Corporation . It occurs after all database retrievals has finished and before any User-invoked events.

IBM Global Services Questions  What are the different events in an ABAP program that can be triggered before user interaction ? When do they get triggered ?  What are the user-invoked events for a list display ?  What are the events used for displaying Headers and Footers in a list ? When are these events invoked ?  Which part of a code in a program are executed for an event ? 23 ABAP Events | 4.02 March-2005 © 2005 IBM Corporation .

.8985.7.0/  !.    47547.4-.943 .$07.0398  .08 038.

70.2  !.0398/408 349/0503/439047/073.7.039 .3/%&$#   .039 $%#%  $%  %80.7 441.439740/-0..85.709700/1107039:807 3.7941.4-.   $% 890.898890297070/0.:94347/07410.3&807 3.70.93.8.4/0/.81380/.:94341.7941900.0398 94..30 .:78.94308570880/ % $%  0390 :807/4:-0 .$07.3!5747.3/ -01470.40/0.5:8-:9943 47800.    47547.:784343.0/:739000.-..40/0.3 !5747.9.2 94.1907.03989.843.5747.:942.9.3!5747.90203989.705.70349..30.28.03994-0574.3/0/ 1742.343..4/0/3905747.2 !89.93.203:902 .2  %! 03./.9.0398 0.039/408349300/94-0.943 ..0880//:73 907:392041.0398  .3 !5747.4/0/05.2 909897070/.90.3:3.9.08 $:22.8070970.

9.7090800.9.8903 .3-097070/-01470 :8073907.89/85.30.7941.7090:807 3....7090/11070390.0398:80/147/85.    47547.70900.40/ .40/0.4/03.$07.94303/4900997070/ .:90/147.2.29.03983.08 ":089438 .9./078.30.03983.5.9. ..5747.4-.7000.3/4490783.0398147.0398  .3!5747.943 .039  !.7.