Vous êtes sur la page 1sur 14

Events in Module-Pool

Module pool programs


For reports, Online executable programs
are written but for Transactions, Module
pool programs are written.
The module pool program contains data
declaration statements and pool of modules
to handle various events associated with
screen.
Events associated with Screen
When transaction is executed, the screen is
displayed, user enters few fields, selects few
functions. Then the screen is processed.
Processing of screen is done by flow logic.
Events associated with Screen
The events that are associated with flow
logic are as follows.
Process Before Output (PBO).
Process After Input (PAI).
Process On Value request (POV).
Process On Help request (POH).
The system automatically displays PBO and
PAI in flow logic.
Process Before Output(PBO)
This event is triggered before the screen is
displayed.
The processing of screen before the screen
is displayed is done in this event.
For example, filling in default values in the
screen fields.
Process After Input (PAI)
This event is responsible for processing of
screen after the user enters the data and
clicks the pushbutton or any GUI option.
Function code plays an important role in
this operation.
Defining the Flow Control
PROCESS BEFORE OUTPUT.
MODULE INITIALIZE.

PROCESS AFTER INPUT.
MODULE READ_SPFLI.
Screen
Painter
Action Sequence
PROCESS BEFORE OUTPUT.
MODULE

PROCESS AFTER INPUT.
MODULE
Screen Painter
A
B
Action sequence
Execute module A
Data transport from
ABAP/4 to screen
work area
Send screen
ENTER
Data transport from
screen to ABAP/4
work area
Execute module B
Field Format Checking
Field list
Field name Format
DATE
DATS
...
Amount
DEC
Screen Painter
Date
Amount
E: Invalid date
30.02.1996
E: Please enter numeric value
Date
Amount
12A3
Input Checking in the Module Pool
Screen Painter ABAP/4
PROCESS AFTER INPUT.
FIELD <screen field>
MODULE <module>
Module <module> INPUT.
.
.
message E......
Endmodule
E... message
ready for input again
FIELD Statement and Data Transport
PROCESS AFTER INPUT.
MODULE
Field MODULE
Field MODULE
MODULE
Screen Painter
D
Action sequence
ENTER
Data transport for all
fields other than X,Y
from screen to ABAP/4
work area
Execute module A
Data transport for X
Execute module B
Execute module C
X
B
Y C
A
Data transport for Y
Execute module D
Process On Value request(POV)
This event is triggered when the user clicks
F4 function key.
We can handle this event by writing our
own code in the module pool program.
By clicking F4 function key, list of
possible values are displayed.
Process On Help request(POH)
This event is triggered when the user clicks
F1 function key.
We can handle this event by writing our
own code in the module pool program.
By clicking F1 function key, system
displays Help for that particular field.

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.
ENDMODULE.
MODULE F1_HELP_FIELD4 INPUT.



CALL FUNCTION 'HELP_OBJECT_SHOW'
EXPORTING
DOKCLASS = 'TX'
DOKLANGU = SY-LANGU
DOKNAME = 'DEMO_FOR_F1_HELP'
DOKTITLE = TEXT-003
TABLES
LINKS = LINKS.
ENDMODULE.