Yes, this should be possible.
First you would need to implement an event handler for the event double_click
of cl_gui_alv_grid
. You do that by creating a local class with an event handler method:
CLASS lcl_alv_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
on_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no.
ENDCLASS.
Then you need to implement the method on_double_click
to read the clicked line from your data table using the content of the parameter e_row
and then use CALL TRANSACTION
to start the transaction PA20. You can also perform some actions in the transaction PA20 before giving control to the user, like entering a personnel number or the time and then performing the "view" action. You do that by passing a table with batch-input actions using the addition USING bdc_tab
to CALL TRANSACTION. More about that in the documentation which also includes an example how to do it with a batch input table.
Then you assign that event handler after you created your ALV grid:
SET HANDLER lcl_alv_event_handler=>on_double_click FOR go_alv.