Anda di halaman 1dari 6

ABAP includes the following keywords for creating data objects and data types statically:

The DATA Statement [Page


119]
for creating variables
The CONSTANTS Statement
[Page 127]
for creating constants
The STATICS Statement [Page
128]
for creating variables which exist as long as the program
runs, but are only visible in a procedure
The TABLES Statement [Page
129]
for creating table work areas
The TYPES Statement [Page
130]

1. Initialization
2. At line-selection
3. Start-of-selection
4.Top-of-page
5. Top-of -page during at line-selection
6. At PF
7. At user-command
8.End-of-selection
9. End-of-page

Hi Kiran,
Below is the list of events:

Initialization : triggered when the report is loaded in memory.

At selection-screen output : triggered when the selection screen is loaded in memory before
being displayed.

At selection-screen / <field> : before leaving the selection screen.

start-of-selection : the first event for displaying the report.

end-of-selection : after the start-of-selection is completed.

classiscal report events.

top-of-page : every time a new page is started in the list.

end-of-page : every time the list data reaches the footer region of the page.

interactive report events.

top of page during line selection : top of page event for secondary list.
at line-selection : evey time user dbl-clicks(F2) on the list data.

at pF<key> : function key from F5 to F12 to perform interactive action on the list.

Hope this serves your need.


Regards:
Sapna

There is no mandatory event in a report program. Events are actually used to organize the
statements and control the flow of the program. If the program contains no explicitly
defined event blocks, all the statements in the program form the entire event block
START-OF-SELECTION. ABAP runtime environment automatically introduces a
START-OF-SELECTION at the first execution line.

ABAP/4 report programs are event driven programs. Following events are triggered in a
report.

LOAD OF PROGRAM. - If propgram is of type 1, M, F, or S; then LOAD-OF-


PROGRAM is trigerred first and then INITIALIZATION. The purpose of load of
program is to load the program into system memory so that the program can be executed.

INITIALIZATION. - just once.

AT SELECTION-SCREEN OUTPUT. - when there is selection-screen

AT SELECTION-SCREEN. - when user interacts.

START-OF-SELECTION. - when F8.This is the default event in ABAP.

END-OF-SELECTION. - At the end

EVENTS IN A CLASSICAL REPORT:

1. INITIALIZATION: This is triggered when the report is loaded in memory.

2. AT SELECTION-SCREEN OUTPUT: This is triggered when the selection screen is


loaded in memory before being displayed.

3. AT SELECTION-SCREEN/<field> : This event is triggered before leaving the


selection screen.

4. START-OF-SELECTION: This is the the first and default event for displaying the
report. Data retrieval logic is written under this event.
OUTPUT EVENT(5, 6):
5. TOP-OF-PAGE: This event is triggered every time a new page is started in the list.

6. END-OF-PAGE : This event is triggered every time the list data reaches the footer
region of the page.

7. END-OF-SELECTION: This event is triggered after the START-OF-SELECTION is


completed.
This event is used when there is use of logical data base in the report. It is triggered in
type 1 programs once the logical database completes reading all data i.e. all the selection
is finished and before the list processor is started. This statement tells the server that all
the database reading is completed and no more data reading is going to take place. END-
OF-SELECTION is generally used for the summary/results of reports. In an executable
program without logical data base, there is no need to implement the event block END-
OF-SELECTION.
After a program is executed by the user, the database is locked when it encounters a
START-OF-SELECTION statement and the lock is released when an END-OF-
SELECTION statement is encountered (to maintain the consistency). Data selection is
done between START-OF-SELECTION and END-OF-SELECTION. Now if we don’t
write the END-OF-SELECTION statement, the database will remain locked till the
programs get terminated. Hence, the performance will be reduced. So it is always good
practice to write END-OF-SELECTION statement after finishing the data selection from
database.

EVENTS IN AN INTERACTIVE REPORT:

In addition of the above, the following events are possible in case of Interactive Reports.

1. Top of page during line selection : top of page event for secondary list.

2. At line-selection : evey time user dbl-clicks(F2) on the list data.

3. At pF<key> : function key from F5 to F12 to perform interactive action on the list.

4. At user-command.

==================================================

Finally I want to include one point:


If you debug your report program from the Abap editor screen then it triggers from
1.Initialization,
2.At Selection-screen,
3.Start-of Selection,
4.End-of Selection,
5.Top-of-page,
6.End-of-page.
But if you debug from the selection-screen then it triggers from
1.At Selection-Screen,
2.Start-of-selection,
3.Top-of-page,
4.End-of-page.

ABAP is an event-driven programming language. The general flow of an ABAP program is controlled by
events. These events are defined in an ABAP program using event keywords. All statements between event
keywords or between an event keyword and a FORM statement form processing blocks.
For clarity of reading code, it is good programming practice to code event processing blocks in the order in
which they will be triggered during execution. However, they do not have to be coded in a sequential order.
Within an ABAP Processing Block, statements are processed sequentially (top to bottom).
Finally, the code in the END-OF-SELECTION processing block is executed.
All ABAP statements that are not written as part of a processing block (after an event keyword) or a FORM-
ENDFORM block are automatically part of the Start-of Selection processing block if they are coded above all
other event keywords or subroutines.
Following are the system-triggered events which occur during the run time of a report program . These
events are presented in the order in which they are processed. These are called run time events.

Run time Event: Initialization


If a report has a selection screen defined (either explicitly or by default through the use of a logical
database), the ABAP processor processes the selection screen first. A programmer can execute another
block of code before the selection screen by using the event keyword INITIALIZATION. This processing
block can be used to define characteristics of the selection screen. Examples include : setting default values
on selection fields, setting a title bar, assigning text to push buttons, etc.

Run time Event: AT SELECTION-SCREEN


AT SELECTION-SCREEN occurs when the user triggers a function code on the selection screen (i.e., by
clicking on push-button, hitting a function key, etc.). Checks can be made on selection screen fields and
appropriate messages sent back to the user (error, confirmation, warning messages), or the program can be
terminated. After the user enters new information, AT SELECTION-SCREEN is triggered again.

Run time Event: START-OF-SELECTION


START-OF-SELECTION is triggered after the selection screen is processed, and before any GET events or
any other event processing blocks. If no event keywords are coded in a report program, the report statement
automatically starts START-OF-SELECTION processing (it can be explicitly coded, but need not be). All
ABAP statements that are not part of a processing block (after an event keyword) or a FORM-ENDFORM
block are automatically part of the START-OF-SELECTION processing block if they are coded above all
other event keywords or subroutines. The Syntax Check will offer a warning if it detects that a line of code is
inaccessible due to being severed from an event processing block.
START-OF-SELECTION can be used to set default values of program-defined variables, or to code WRITE
statements to be output to the screen.

Run time Event: GET and GET LATE


GET <table> events can only be used for the basic list in an interactive report. The GET event is triggered
each time a row is read from a logical database table. The data for this record is loaded into the table work
area. A GET event keyword can only be coded once for any one table in the logical database program.
The GET <table> LATE event, if coded, occurs just before the next row (record) of the table specified in the
GET event is selected from the database. It also occurs after any other GET or GET LATE events for
tables lower in the hierarchy of the logical database program.
GET event processing requires that the logical database be specified as an attribute of the report program
(while in the ABAP Editor, use the menu path Go to -> Attributes).

Run time Event: END-OF-SELECTION


END-OF-SELECTION is the last system event to be processed during the runtime of a report program. It
occurs after all logical database records have been read, and before any user-invoked events. END-OF-
SELECTION occurs only once.

The other set of events that occur occur while the ABAP processor is processing the output list of a report
program are called output events.

Output Event: TOP-OF-PAGE


TOP-OF-PAGE is used for page headers on the basic list only. TOP-OF-PAGE is triggered when the system
encounters a WRITE, SKIP, or ULINE statement on the basic list. TOP-OF-PAGE occurs the moment the
first line of the first page is written to the screen. NEW-PAGE also invokes the TOP-OF-PAGE event.
TOP-OF-PAGE DURING LINE-SELECTION allows a programmer to display headers for detail lists (other
than the basic list).
TOP-OF-PAGE DURING LINE-SELECTION is triggered with a WRITE, SKIP or ULINE statement on a
detail list.

Output Event: END-OF-PAGE


The END-OF-PAGE event is used for page footers. This event is triggered when the system encounters
insufficient space on the current output page. The LINE-COUNT statement within the REPORT statement
specifies the size of the page area. If a LINE-COUNT is not explicitly coded, the END-OF-PAGE event
block will not be processed.

Proper usage of LINE-COUNT is to include the number of lines per page, as well as how many lines are
reserved for the footer.
For example, the following statement will display 50 lines of output, and then 3 lines of footer information.
REPORT YPROG LINE-COUNT 53(3).

There are several events


In Clasical Reports
1.Initialization
2.At Selection-Screen.
3.Start-Of-Selection.
4.Top-of-page.
5.End-of-page.
6.End-of-selection.
In Interactive Reports
1.At Line-Selection.
2.At PF key
3.At User-Command
4.Top-of-page During Line-Selection.

The Events in ABAP are,


Classical Events.
1) Initialization
2) Load of Program
3) At selection-screen output
4) At Selection-Screen of Field
5) At Selection-Screen on Value-Request
6) At Selection-Screen on Help-Request
7) At Selection-Screen
8) Start of Selection
9) End of Selection
10) Top of Page
11) End of Page

Interactive Events
12) At Line-Selection.
13) At PF key
14) At User-Command
15) Top-of-page During Line-Selection.

Module pool Programming events are


1) PAI - Process After Input
2) PBO - Process Before Output
3) POV - Process On Value Request (F1 HELP)
4) POH - Process On Help Request (F4 HELP)

Anda mungkin juga menyukai