Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

pai

Former Member
0 Kudos

what are the purpose of events pai,pbo and when will they exactly trigger

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi sandeep,

1. As the full form says :

PBO = <b>Just BEFORE screen is displayed</b>.

(This can be used to populate values in the fields)

PAI = <b>When we press ENTER, or any application Toolbar, or any ACTION

is done on the screen.</b>

(This is used for detecting the user action fcode)

regards,

amit m.

7 REPLIES 7

former_member196280
Active Contributor
0 Kudos

PAI -- Once you enter all the values in the screen PAI event get triggered and all validations done here.

PBO -- Once the output is displayed onto the screen, this event gets triggered.

Reward points to all useful answers.

Regards,

Sairam

Former Member
0 Kudos

Hi,

every screen flow logic will have one PBO and one PAI.

PBO(process before output) will be triggered before the screen appearance.

PAI(process after input) will be triggered once we click on any of the button or menu item on the screen.

rgds,

bharat.

Former Member
0 Kudos

Hi,

PBO is first event triggered in module pool.process before output event triggered before the screen is displayed.

PAI is event when the user press on push button,or on menu bar.when user performed action on the screen,then it will trigger.

first trigged event is PBO then PAI.

in module pool by defalut PBO is triggered.

in reports by default START-OF-SELECTION event is triggered

check this link

http://help.sap.com/saphelp_47x200/helpdata/en/47/e07f622b9911d2954f0000e8353423/content.htm

TABLES: sflight.

*----


  • G L O B A L I N T E R N A L T A B L E S

*----


DATA: gi_sflight TYPE STANDARD TABLE OF sflight.

*----


  • G L O B A L D A T A

*----


DATA: OK_CODE LIKE SY-UCOMM,

g_wa_sflight LIKE sflight.

  • Declare reference variables to the ALV grid and the container

DATA:

go_grid TYPE REF TO cl_gui_alv_grid,

go_custom_container TYPE REF TO cl_gui_custom_container.

&----


*& Selection ScreenSection for the ALV Grid

&----


selection-screen begin of block add1 with frame title text-001.

select-options : s_carrid for sflight-carrid.

selection-screen end of block add1.

*----


  • S T A R T - O F - S E L E C T I O N.

*----


START-OF-SELECTION.

SET SCREEN '100'.

&----


*& Module USER_COMMAND_0100 INPUT

&----


MODULE user_command_0100 INPUT.

CASE OK_CODE.

WHEN 'EXIT' OR 'CANCEL'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'STATUS'.

  • Create objects

IF go_custom_container IS INITIAL.

CREATE OBJECT go_custom_container

EXPORTING container_name = 'ALV_CONTAINER'.

CREATE OBJECT go_grid

EXPORTING

i_parent = go_custom_container.

PERFORM load_data_into_grid.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Form load_data_into_grid

&----


FORM load_data_into_grid.

  • Read data from table SFLIGHT

SELECT *

FROM sflight

INTO TABLE gi_sflight

where carrid in s_carrid.

  • Load data into the grid and display them

CALL METHOD go_grid->set_table_for_first_display

EXPORTING i_structure_name = 'SFLIGHT'

CHANGING it_outtab = gi_sflight.

ENDFORM. " load_data_into_grid

Regards,

Priyanka.

Former Member
0 Kudos

Hi,

The control statements that control the screen flow.

PBO - This event is triggered before the screen is displayed.

PAI - This event is responsible for processing of screen after the user enters the data and clicks the pushbutton.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

hi

PBO will be triggered in module pool.it is triggered before the screen is displayed.

PAI is triggered after the user apply the input.

first trigged event is PBO then PAI. after that also pbo will be triggered.

ex:

pbo - pf status.and corresponding actions.

pai- get the input and process it/.

now first pbo will be triggered. then pai. after processing the input again pbo will be triggered..

in module pool by defalut PBO is triggered first.

reward if useful.

Former Member
0 Kudos

Hi sandeep,

1. As the full form says :

PBO = <b>Just BEFORE screen is displayed</b>.

(This can be used to populate values in the fields)

PAI = <b>When we press ENTER, or any application Toolbar, or any ACTION

is done on the screen.</b>

(This is used for detecting the user action fcode)

regards,

amit m.

Former Member
0 Kudos

Keyword PROCESS defines the processing blocks of the dynpro flow logic. The corresponding events are triggered in the following manner by the ABAP runtime environment while processing a screen:

The event PROCESS BEFORE OUTPUT (PBO) is triggered by the runtime environment before the screen of a dynpro is sent to the presentation server. After processing the relevant event block, the contents of global fields of the ABAP program are transported to screen fields of the same names and then displayed as screen in the window.

The event PROCESS AFTER INPUT (PAI) is triggered by a user action on the user interface, which is associated with a function code. At the PAI event or during the processing of the relevant event block, the contents of the screen fields are transported to the data objects with the same names in the corresponding ABAP program. Before executing the relevant event block, automatic input checks are executed, which are defined either in the system or in the ABAP Dictionary. While the event block and the PBO event block of the next dynpro are processed, the screen of the current dynpro remains in the display, but the user interface is inactive. After the PAI processing is finished, the event PBO of the next dynpro is triggered or, if the current dynpro is the last one in its dynpro sequence, the execution returns to the position from which the dynpro sequence was called.

The events PROCESS ON HELP-REQUEST (POH) and PROCESS ON VALUE-REQUEST (POV) are triggered by the request for the field help (F1) or the input help (F4) for a screen element of the screen. In the relevant event block, the MODULE statement is executed, which is assiciated with the FIELD statement for the screen field of the selected screen element. If several FIELD statements exist for the same screen field, only the first is executed. The content of the field specified under FIELD is not automatically passed to the called module in the event block at POH or POV. After POH or POV processing is finished, the system returns to processing the screen displayed on the presentation server, without triggering the PBO event.

There must be at least one PROCESS BEFORE OUTPUT statement in the dynpro flow logic. In addition, PROCESS BEFORE OUTPUT must always be placed before PROCESS AFTER INPUT. PROCESS ON HELP-REQUEST or PROCESS ON VALUE-REQUEST can only be specified, if PROCESS AFTER INPUT is specified first. Other processing blocks except the four that start with PROCESS are not allowed in the dynpro flow logic.

Processing of the event blocks at PAI of the current and at PBO of the next dynpro form one dialog step.

Specifying the screen blocks at POH and POV overrules field and input helps defined by the system or in the ABAP Dictionary. You must specify those only if the predefined helps are not sufficient.