SAP Events

24
Satyam Computer Services Ltd, Pune, India 1999 Author SCSL, Pune Events

description

SAP

Transcript of SAP Events

WS Warehousing & ShippingAuthor
Topics covered
Terminating Processing Blocks
What is an Event ?
Event can be called as a notification to the outside that something has happened inside the system.
Satyam Computer Services Ltd, Pune, India 1999
ABAP/4 is an event driven language.
This means that the general flow of an ABAP/4 program is controlled by events.
Satyam Computer Services Ltd, Pune, India 1999
Events and their Event Keywords
The interface between events and the program is provided by event keywords.
E. g.
REPORT SAPMZTST.
Defining Processing Blocks
Processing block is a piece of code ,you write after the event keyword and you want it to be executed when the particular event takes place.
E. g.
REPORT SAPMZTST.
Classes of Events:
During the display of lists on the screen
Satyam Computer Services Ltd, Pune, India 1999
Classes of Events:
Top-of-page.
End-of-Page.
INITIALIZATION.
During the display of lists on the screen
AT LINE-SELECTION.
AT USER-COMMAND.
INITIALIZATION
If you want to execute a processing block before the selection screen is processed, you can assign it to the event keyword INITIALIZATION.
you specify statements which initialize the selection screen,
for example by changing
Satyam Computer Services Ltd, Pune, India 1999
AT SELECTION-SCREEN
Point after processing user input on the selection screen while the selection screen is still active
The options of the event keyword AT SELECTION-SCREEN enable you to create processing blocks for special events during the processing of the selection screen.
Satyam Computer Services Ltd, Pune, India 1999
START-OF-SELECTION
The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables.
Tip:
Also all statements that are not attached to an event and written before a form statement are included in this event
Satyam Computer Services Ltd, Pune, India 1999
END-OF-SELECTION
To define a processing block after the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION
Satyam Computer Services Ltd, Pune, India 1999
TOP-OF-PAGE
The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list.
The system processes the statements following TOP-OF-PAGE before outputting the first line on a new page.
Satyam Computer Services Ltd, Pune, India 1999
End-of-Page
To define a page footer, use the END-OF-PAGE event.
Event occurs if, while processing a list page, the system reaches the lines reserved for the page footer,
Satyam Computer Services Ltd, Pune, India 1999
AT LINE-SELECTION
To allow the user to select a line from the list, define and write a processing block for the AT LINE-SELECTION event in your program
AT LINE-SELECTION.
Satyam Computer Services Ltd, Pune, India 1999
AT PF<nn>
To allow the user to select an action by pressing a function key, define and write a processing block for the AT PF<nn> event in your program.
At Pf <nn>.
Write :/ ’User has pressed function key’ , nn.
Satyam Computer Services Ltd, Pune, India 1999
The system does not trigger an event AT PF<nn> for keys whose function code is predefined..
Satyam Computer Services Ltd, Pune, India 1999
AT USER COMMAND
AT USER-COMMAND.
CASE SY-UCOMM.
ENDCASE.
Terminating Processing blocks
Branching to END-OF-SELECTION
Leaving AT Events
Branching to END-OF-SELECTION
You can leave any processing block immediately and branch to the END-OF-SELECTION processing block by using the STOP statement.
Satyam Computer Services Ltd, Pune, India 1999
You can leave any processing block (except of AT events) immediately and branch to the output screen by using the EXIT statement .
Branching to the Output Screen
Satyam Computer Services Ltd, Pune, India 1999
Leaving At Events
If you use the EXIT statement in the processing blocks of AT events the system leaves this processing block and branches to the processing block of the next occurring event.
Satyam Computer Services Ltd, Pune, India 1999
Leaving Processing Blocks Conditionally
You can leave any processing block conditionally by using two variants of the CHECK statement .
CHECK <condition>.