ABAP How to get ALV events

  Report Program

Over View

Let’s explain how to change to another screen when double-clicking the displayed ALV.
It is possible to transition to the standard transaction or display another ALV as in the sample below.
This time, some excerpts are described, so refer to here if you want to check the creation of ALV.

Sample Code


Function module: Let’s set i_callback_program and i_callback_user_command when using REUSE_ALV_GRID_DISPLAY.
For general ALV reports, specify your own program name for i_callback_program and the FORM name you want to execute for i_callback_user_command.
In this example, FORM: USER_COMMAND is executed when ALV is double clicked. Check ucomm argument and only when ‘& IC1’ (double click)
Let the process run. FORM: USER_COMMAND was not executed by single click, but it is recommended to check it just in case.
Next, selfield-tabindex contains the selected row number, so let’s use that value to get the value from the internal table we passed to ALV.
* Even if it is sorted or filtered, there is no problem just by checking INDEX.
The selected column name is entered in selfield-fieldname, so check it if you want to change the processing depending on the selected column.
Please see here for the basic method of making an ALV
Please see here to change the ALV header text