0% found this document useful (0 votes)
2 views

Chapter 02_ABAP Events

The document outlines the objectives and key concepts of ABAP Event-Driven Programming, detailing system-triggered events such as INITIALIZATION, START-OF-SELECTION, and END-OF-SELECTION, as well as user-invoked events like AT PF## and AT LINE-SELECTION. It emphasizes that the flow of an ABAP program is controlled by events, which do not depend on their coding order. The document also includes demonstrations and practice exercises to reinforce understanding of these events.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 02_ABAP Events

The document outlines the objectives and key concepts of ABAP Event-Driven Programming, detailing system-triggered events such as INITIALIZATION, START-OF-SELECTION, and END-OF-SELECTION, as well as user-invoked events like AT PF## and AT LINE-SELECTION. It emphasizes that the flow of an ABAP program is controlled by events, which do not depend on their coding order. The document also includes demonstrations and practice exercises to reinforce understanding of these events.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

IBM Global Services

ABAP Events

ABAP Events | Dec-2008 © 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 | Dec-2008 © 2005 IBM Corporation


IBM Global Services

ABAP Event-Driven Programming


Program Code Program List
Flow Produced
REPORT ZPB001.

NODES:BSIK.

DATA: VAR1(4) VALUE ‘0001’. Program Header

GET BSIK. START-OF-SELECTION has occurred


IF SY-LINNO < 5. 2 100000 0001
WRITE: / BSIK-LIFNR, VAR1. END-OF-SELECTION has occurred
ENDIF.

END-OF-SELECTION.
WRITE: / ‘END-OF-SELECTION’,
3
‘has occurred’.

START-OF-SELECTION.
WRITE: / ‘START-OF- 1
SELECTION’,
‘has occurred’.

3 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Runtime Event : INITIALIZATION

Execute a processing block


before the selection screen

4 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Runtime Event : AT SELECTION-SCREEN

Trigger a function code


on the selection screen

5 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Runtime Event: START-OF-SELECTION

Can be coded explicitly, but


need not be.

6 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Runtime Events : GET and GET LATE

Select records
from logical
database tables

7 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Runtime Event : END-OF-SELECTION

Last system event to occur.


Occurs only once

8 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Output Event : TOP-OF-PAGE

Used for page headers


for the basic list only

9 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Output Event : TOP-OF-PAGE DURING LINE-SELECTION

Used for page headers


on detail lists

10 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Output Event : END-OF-PAGE

Used for page footers

11 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Demonstration

 Observe the following system-triggered events during execution of a Report


program.
 INITIALIZATION.
 AT SELECTION-SCREEN.
 START-OF-SELECTION.
 GET <table>.
 GET <table> LATE.
 END-OF-SELECTION.
 TOP-OF-PAGE.
 END-OF-PAGE.

12 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Practice

 Observe the following system-triggered events during execution of a Report


program.
 INITIALIZATION.
 AT SELECTION-SCREEN.
 START-OF-SELECTION.
 GET <table>.
 GET <table> LATE.
 END-OF-SELECTION.
 TOP-OF-PAGE.
 END-OF-PAGE.

13 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

List Display (User) Events

Order of execution determined by user

14 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

List Display Event : AT PF##

Triggered by function code

PF##

15 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

List Display Event : AT LINE-SELECTION

Triggered by function code

PICK
16 ABAP Events | Dec-2008 © 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 | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Demonstration

 Observe the following user-invoked List Display events after the Basic List has
been generated by a Report Program.
 AT PF##.
 AT LINE-SELECTION.
 AT USER-COMMAND.

18 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Practice

 Observe the following user-invoked List Display events after the Basic List has
been generated by a Report Program.
 AT PF##.
 AT LINE-SELECTION.
 AT USER-COMMAND.

19 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

List Display Events (“User” Events) - Typical Usage

Event Triggered by Typical User


Function Code Action Assigned

AT PF## PF## Function key


pressed

AT LINE-SELECTION PICK Mouse double-click,


Or single click + F2

AT USER-COMMAND ALL OTHER CODES Click on a push- button, or


select a menu item

20 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

When Is a List Displayed?

21 ABAP Events | Dec-2008 © 2005 IBM Corporation


IBM Global Services

Summary

 Flow of an ABAP program is controlled by events. Execution order of events does


not depend on the order in which they are coded in the program.
 All ABAP statements that are not coded as part of an event, are part of the event
START-OF-SELECTION. This event does not need to be coded explicitly in an
ABAP program. It gets triggered automatically.
 END-OF-SELECTION is the last system triggered event to be processed during
the runtime of a program. It occurs after all database retrievals has finished and
before any User-invoked events. It occurs only once during the execution of an
ABAP program.
 AT PF## (when any Function key is pressed), 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.

22 ABAP Events | Dec-2008 © 2005 IBM Corporation


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 | Dec-2008 © 2005 IBM Corporation

You might also like