The AT PF ## Event
The AT PF ## Event |
Dec-2008
Objectives
The AT PF ## Event |
Dec-2008
Procedural Language
VS
Starts at the
beginning
of the code
Completes
at the end
of the code
The AT PF ## Event |
Event-driven Language
Event z
Event y
3rd
Event x
1st
Event w
2nd
PF##
4
The AT PF ## Event |
Dec-2008
REPORT Y190XX01.
DATA: WA_LFA1 TYPE LFA1.
SELECT *
CHECK
A New
ABAP
Event
SY-SUBRC
START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1.
WRITE: / WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.
ENDSELECT.
AT PF06.
WRITE: / The user has just pressed the F6 key.
.
SYNTAX: AT PF<##>.
The AT PF ## Event |
Dec-2008
F2
F3
F4
The AT PF ## Event |
Demonstration
Invoking AT PF## Events from a basic list.
The AT PF ## Event |
Dec-2008
Practice
Invoking AT PF## Events from a basic list.
The AT PF ## Event |
Dec-2008
REPORT Y190XX01.
DATA:WA_LFA1 TYPE LFA1.
START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1.
WRITE: / WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.
ENDSELECT.
AT PF06.
WRITE: / The user just pressed the F6 key.
AT PF07.
WRITE: / The user just pressed the F7 key.
The AT PF ## Event |
Dec-2008
Commenting in this manner helps to make the start and end of an event
more apparent.
10
The AT PF ## Event |
Dec-2008
A New
ABAP
Reserved
Word
CHECK
SY-SUBRC
START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1.
WRITE: / WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.
ENDSELECT.
AT PF06.
WINDOW
STARTING AT 10 4
ENDING AT 77 12.
WRITE: / The user just pressed the F6 key.
AT PF07.
WRITE: / The user just pressed the F7 key.
.
11
The AT PF ## Event |
Dec-2008
COLUMN 77
TITLE
ROW 4
TITLE
ROW 12
12
The AT PF ## Event |
Dec-2008
Hey!?!
Whats
up here???
3.
2.
1.
13
The AT PF ## Event |
Dec-2008
Basic List
SY-LSIND = 0
F6
F6
A New
ABAP
System Field
14
The AT PF ## Event |
Dec-2008
15
The AT PF ## Event |
Dec-2008
16
The AT PF ## Event |
Dec-2008
17
The AT PF ## Event |
Dec-2008
Demonstration
Creation of additional screens from a list and restricting the user from creating
redundant screens.
18
The AT PF ## Event |
Dec-2008
Practice
Creation of additional screens from a list and restricting the user from creating
redundant screens.
19
The AT PF ## Event |
Dec-2008
A New
ABAP
Event
SYNTAX: TOP-OF-PAGE.
20
The AT PF ## Event |
CHECK
SY-SUBRC
START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1.
WRITE: / WA_LFA1-LIFNR,
WA_LFA1-NAME1, WA_LFA1-ORT01.
ENDSELECT.
*-----BEGINNING OF TOP-OF-PAGE EVENT
-----*
TOP-OF-PAGE.
WRITE: / This is the header of the basic
list.
*-----END OF TOP-OF-PAGE
EVENT-----------------*
AT PF06.
CHECK SY-LSIND = 1.
WRITE: / The user just pressed the F6
key.
Dec-2008
21
The AT PF ## Event |
Dec-2008
Summary
In an ABAP program, user events are recognized by the Function codes. Which
event has been triggered by the user is determined by the Function code.
At a time 20 detail lists can be opened.
Some Function keys are reserved for ABAP Functions. Though, ABAP program
can be written to override these, but typically, reserved keys are not used unless
required.
System field SY-LSIND contains the number of additional lists the user has
created. This field can be used to restrict the user from creating additional
windows.
TOP-OF-PAGE event triggers when the first statement for the basic list, i.e.
WRITE, SKIP etc. Similarly, TOP-OF-PAGE DURING LINE-SELECTION is
triggered when first list statements are encountered in a detail list.
22
The AT PF ## Event |
Dec-2008
Questions
How does the order of execution depends on the way the events are coded inside
the program ?
What is a detailed list ?
How the user can be restricted from creating unnecessary windows by pressing
the same Function key or pushbutton ?
How will you create new windows with specific size ?
How can you programmatically manage the heading of basic and detail lists ?
23
The AT PF ## Event |
Dec-2008