Application Development and Automation 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: 
Read only

ABAP

Former Member
0 Likes
708

What are the various events used in ABAP and Module Pool Programming?

1 ACCEPTED SOLUTION
Read only

Former Member
6 REPLIES 6
Read only

former_member188829
Active Contributor
0 Likes
643

Hi Sachin,

1)classical report.

-Initialization.

-At Selection-screen output.

-At selection-screen.

-Top-of-page.

-Start-of-selection.

-End-of-page.

-End-of-selection.

2)Interactive Reports.

Above events and

-At line-selection.

-Top-of-page during line-selection.

in MODULEPOOL proramming

1)PAI

2)PBO

3)POH

4)POV

Read only

Former Member
Read only

Former Member
0 Likes
643

Hi ,

EVENTS IN REPORTS :

INITIALIZATION

AT SELECTION-SCREEN OUTPUT .

AT SELECTION-SCREEN .

AT SELECTION-SCREEN ON <field>

AT SELECTION-SCREEN ON BLOCK <block>

AT SELECTION-SCREEN ON HELP-REQUEST FOR <field>

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>

AT SELECTION-SCREEN ON RADIOBUTTON GROUP <radi>

AT SELECTION-SCREEN ON END OF <seltab>

START-OF-SELECTION .

TOP-OF-PAGE

END-OF-PAGE.

END-OF-SELECTION .

FOR INTERACTIVE REPORTING :

AT LINE-SELECTION .

AT USER COMMAND .

AT PF-KEY .

TOP-OF-PAGE DURING LINE-SELECTION .

MODULE POOL PROGRAM EVENTS :

1 . PROCESS BEFORE OUTPUT .(PBO)

This event 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.

Default Module : MODULE STATUS_0100 OUTPUT.

2 . PROCESS AFTER INPUT .(PAI)

This event 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.

Default Module : MODULE USER_COMMAND_0100 INPUT

3 .. PROCESS ON HELP REQUEST . (POH)

4 . PROCESS ON VALUE-REQUEST (POV)

These events are triggered when the user requests field help (F1) or possible values help (F4) respectively. You can program the appropriate coding in the corresponding event blocks. At the end of processing, the system carries on processing the current screen.

Read only

Former Member
0 Likes
643

Hi Sachin,

<b>Event related to reports are not triggered based on any statements in ABAP. </b>

The event are triggered depended on the way the output is generated .

<b>classiscal report events.</b>

for eg:

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.

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.

<b>interactive report events.</b>

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.

<b>Module pool events</b>

<b>Process Before Output(PBO)</b>

Processing before the screen is displayed (PBO).

Examples

Initializing screen fields, inserting default values, positioning the cursor, showing and hiding fields and changing field attributes dynamically.

<b>Process After Input(PAI)</b>

Effect

Processing after user input.

Examples

Checking values where there is no automatic check, processing the cursor position, processing correct entries or triggering an error dialog.

<b>Process on Value-request(POV)</b>

Effect

Event in user-programmed help that occurs when the user presses F4 with the cursor positioned on a screen field. The modules specified in the subsequent FIELD statements are called instead of the SAP help system.

Example

FIELD XY MODULE XYZ

Module XYZ determines the value of field XY and places it in the input field on the screen.

<b>Process on Help-Request(POH)</b>

Effect

POH event for user-programmed help. Modules in this event are processed when the user presses F1 with the cursor positioned on a screen field. In the subsequent FIELD statements, you can specify a data element supplement (or determine one in an application module). The texts are then displayed by the help system.

Examples

FIELD XY WITH '0001'.

Displays data element addition 0001 for field XY.

FIELD XY WITH variable.

Displays the data element supplement with the number contained in variable for the field XY.

FIELD XY MODULE XYZ WITH variable .

The relevant data element supplement is determined in module XYZ, where it is placed in variable. Use this procedure whenever you cannot determine the correct data element supplement until the F1 event.

Read only

Former Member
0 Likes
643

I GOT SATISFACTORY ANSWERS FROM ALL THE PARTICIPANTS

Read only

Former Member
0 Likes
643

<b>1INITIALIZATION </b>This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN, <seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined.If you want to initialize input fields of the logical database, you need to find out the names of the fields. To do this for the logical database SAPDB<ldb>, use Transaction SLDB or choose Tools

<b>2 AT SELECTION-SCREEN</b> The event AT SELECTION-SCREEN is the basic form of a whole series of events that occur while the selection screen is being processed.The standard selection screen in an executable program or in the logical database linked to it is automatically called between the INITIALIZATION and START-OF-SELECTION events. When you call the selection screen, and when users interact with it, the ABAP runtime environment generates selection screen events, which occur between INITIALIZATION and START-OFSELECTION.You can define event blocks for these events in your program to change the selection screen or process user input.

<b>3 AT SELECTION-SCREEN ON VALUE-REQUEST for <par>/<sel-op></b> If the user requests a list of possible entries for database-specific parameters <par> or selection criteria <selop>, these events are triggered as required.

<b>4 AT SELECTION-SCREEN OUTPUT</b> This event is called each time the selection screen is sent (before it is displayed). This will trigger the PBO

<b>5 AT SELECTION-SCREEN ON HELP REQUEST</b> If the user requests a list of possible entries for database-specific parameters <par> or selection criteria <selop>, these events are triggered as required.If the user requests field helps for these parameters, the events with the addition ON HELP-REQUEST occurs instead of ON VALUE-REQUEST.

<b>6 AT SELECTION-SCREEN ON BLOCK</b> is triggered when the contents of all of the fields in a block are passed from the selection screen to the ABAP program. You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK <block> and SELECTION-SCREEN END OF BLOCK <block>. You can use this event block to check the consistency of the input fields in the block. If an error message occurs within this event block, the fields in the block are made ready for input again on the selection screen.

<b>7 AT SELECTION-SCREEN ON <field></b> Event for processing a particular input field.

<b>8 AT SELECTION-SCREEN ON RADIOBUTTON GROUP RADI</b> is triggered when the contents of all of the fields in a radio button group are passed from the selection screen to the ABAP program. To define a radio button group <radi>, use the addition RADIOBUTTON GROUP <radi> in the corresponding PARAMETERS statements. This event block allows you to check the whole group. If an error message occurs within this event block, the radio button group is made ready for input again on the selection screen. The individual fields of radio button groups do not trigger the event AT SELECTION-SCREEN ON <field>.

<b>9 AT SELECTION-SCREEN ON END OF <SEL-OPTION>/<field></b> Event for processing multiple selections.

<b>10 START-OF-SELECTION </b>This event occurs after the selection screen has been processed and before data is read using the logical database. You can use it to prepare for reading data and creating the list by, for example, setting values for internal fields and writing introductory notes on the output list.In an executable program, any non-declarative statements that occur between the REPORT or PROGRAM statement and the first processing block are also processed in the START-OFSELECTION block.

<b>11 END-OF-SELECTION </b>This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started. You can use the corresponding event block to process and format the data that the program has stored in internal tables or extracts during the various GET events.

<b>12 TOP-OF-PAGE</b> 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.

<b>13 END-OF-PAGE</b> This statement determines the page length of the output list of program <rep> as <length> lines.If you specify the optional number <n>, the system reserves <n> lines of the page length for the page footer. Those lines of the page footer that are not filled at the END-OF-PAGE event, appear as blank lines

<b>14 AT LINE-SELECTION </b>Data is transferred from the List to the ABAP program via system field or an internal Memory area called “HIDE” area.

<b>15 AT USER-COMMAND</b> Data is transferred from the List to the ABAP program via system ucomm code “sy-ucomm”.

<b>16 AT PF<No.></b> It is obsolete as it is more time consuming

<b>17 AT FIRST</b> First line of the internal table will be written as the output

<b>18 AT LAST </b>Last line of the internal table will be written as the output

<b>19 AT NEW </b>Beginning of a group of lines with the same contents in the field <f> and in the fields left of <f> {“At New” should be used for the key field of the IT.}

<b>20 AT END OF</b> End of a group of lines with the same contents in the field <f> and in the fields left of <f>

<b>21 GET</b> Basically used for the LDB