HI Vijaya,
PROCESS BEFORE OUTPUT (PBO) is automatically triggered after the PAI processing of the previous screen and before the current screen is displayed. You can program the PBO processing of the screen in this block. At the end of the PBO processing, the screen is displayed.
PROCESS AFTER INPUT (PAI) is triggered when the user chooses a function on the screen. You can program the PAI processing of the screen in this block. At the end of the PAI.
processing, the system either calls the next screen or carries on processing at the point from which the screen was called.
Reward Points if this Helps.
Manish
the process goes like this for module pool
first PBO -
> Screen Display -
> PAI
Before screen is displayed if u want to show some default values on screen , u have to write that in PBO
And after some input is entered , to perform validations on those input fields we write the code in PAI
chk these examples
DEMO_DYNPRO_TABLE_CONTROL_1 DEMO_DYNPRO_TABLE_CONTROL_2
hi vijaya,
chk this link.
http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9d2f35c111d1829f0000e829fbfe/frameset.htm
regards,
anver
if helpful pls mark points
The screen flow logic is divided into the Process Before Output (PBO) event, which is processed before the screen is displayed, and the Process After Input (PAI) event, which is processed after a user action on the screen.
The screen flow logic calls dialog modules in the ABAP program, either to prepare the screen for display (PBO event) or to process the user's entries (PAI event).
PROCESS BEFORE OUTPUT (PBO) is automatically triggered after the PAI processing of the previous screen and before the current screen is displayed. You can program the PBO processing of the screen in this block. At the end of the PBO processing, the screen is displayed.
PROCESS AFTER INPUT (PAI) is triggered when the user chooses a function on the screen. You can program the PAI processing of the screen in this block. At the end of
the PAI processing, the system either calls the next screen or carries on processing at the point from which the screen was called.
When you call a screen, the PROCESS BEFORE OUTPUT event (PBO) is called, and the corresponding event block in the screen flow logic is processed. The screen itself is then displayed until the user triggers the PROCESS AFTER
INPUT (PAI) event by choosing a function.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE INIT_SCREEN_100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
PROGRAM DEMO_DYNPRO_DICTIONARY.
TABLES SDYN_CONN.
DATA WA_SPFLI TYPE SPFLI.
CALL SCREEN 100.
MODULE INIT_SCREEN_100 OUTPUT.
CLEAR SDYN_CONN-MARK.
MOVE-CORRESPONDING WA_SPFLI TO SDYN_CONN.
CLEAR WA_SPFLI.
ENDMODULE.
MODULE USER_COMMAND_0100 INPUT.
IF SDYN_CONN-MARK = 'X'.
LEAVE PROGRAM.
ENDIF.
MOVE-CORRESPONDING SDYN_CONN TO WA_SPFLI.
SELECT SINGLE
CITYFROM AIRPFROM CITYTO AIRPTO FLTIME DEPTIME ARRTIME
INTO CORRESPONDING FIELDS OF WA_SPFLI
FROM SPFLI
WHERE CARRID = WA_SPFLI-CARRID AND CONNID = WA_SPFLI-CONNID.
ENDMODULE.
The module USER_COMMAND_100 in the ABAP program reads data from the database table with the key fields specified (and checked) on the screen, and sends them back to the screen in the PBO module INIT_SCREEN_100. The work area SDYN_CONN, defined using the TABLES statement, serves as an interface between
the program and the screen. Meanwhile the data from the database is processed in the work area WA_SPFLI. If the user selects the screen field Cancel (value X), the
program ends.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
PBO - Process Before Output.
The part of code is executed before the screen is displayed and hence you use the same to initialize the screen variables or display data.
Flow Logic
PBO
Module init_screen.
PBO - Include
Module init_screen output.
s_user = sy-uname.
endmodule.
PAI - Process After Input.
It is the part of the code that would be triggered on a user event(enter key press etc). It is mainly used to validate the screen data and do the necessary posting.
PAI.
field s_user module validate_user.
module user_command.
PAI - Include
module validate_user.
if s_user <> sy-uname.
error message.
endif.
endmodule.
module user_command.
case ok-code.
when 'ENT'.
select * into table itab from usr01 where bname = s_user.
endcase.
endmodule.
PBO (PROCEES BEFORE OUTPUT) here before output means before outputting selection screen.
PBO equala to INITIALIZATION and AT SELECTION SCREEN OUTPUT events in normal report.
PAI (process after Input)-------the name itselef is explaing everything.
at selection screen, start of slection etc events of normal report can be compared with this.
POH ( process on help request), u can compare this with AT SELECTION SCREEN ON HELP REQUEST FOR <P>/<S> event
POV(PROCESS ON VALUE REQUEST) , u can compare thios with
AT SELECTION SCREEN ON VALUE REQUEST FOR <P>/<S>
if u search in forum, u can find nice materials regarding
module pool, its better u read those ppts. it will be more helpfull than our explanations.
PBO will be triggred before the screen apears which is similar to initialization event in List Processign
It can be used for SETING pf-status title for the screen.
and also For default values inthe screen we can write the code in PBO.
oNCE DATA IS ENTERED and as per requirement capturing the okcodes VALIDATING THE FIELD VALUES PROVIDING F1 AND F4 HELPS will be done in PAI.
REGARDS
Hi,
in module pool program,there are 2 processes PBO and PAI
<b>PBO(Process before output)</b>
this is trigerred before displaying the output screen
<b>PAI(Process after input )</b>
this is trigerred after the user gives any input
generally in PBO
we set the PF status(setting menus,buttons etc)
in PAI
write the code for handling sy-ucomm that is the 4 character code given for those items set in the
pf-status.
hope this is clear.
just go thru this simple program illustrating PBO and PAI usage
***************************************************
report ymodulepool1 .
data:ucomm like sy-ucomm.
call screen 100.
&----
*& Module pbo OUTPUT
&----
text
----
module pbo output.
set pf-status 'SCN100'.
endmodule. " pbo OUTPUT
&----
*& Module pai INPUT
&----
text
----
module pai input.
ucomm = sy-ucomm.
case ucomm.
when 'EXIT'.
leave program.
endcase.
endmodule. " pai INPUT
regards,
sowjanya
Add a comment