Hi,
Assuming cl_gui_alv_grid is being used.
Consider using event before_user_command OF cl_gui_alv_grid
Some old code:
In the program I have a class cl_event_receiver.
*----------------------------------------------------------------------*
METHODS: before_user_command
FOR EVENT before_user_command OF cl_gui_alv_grid
IMPORTING e_ucomm .
*----------------------------------------------------------------------*
METHOD before_user_command .
me->e_ucomm = e_ucomm .
CASE e_ucomm .
WHEN cl_gui_alv_grid=>mc_fc_call_xxl .
* Your code.....
ENDCASE .
*----------------------------------------------------------------------*
* Global
DATA: ob_gui_alv_grid_1 TYPE REF TO cl_gui_alv_grid .
*----------------------------------------------------------------------*
* At pbo after creation of ob_gui_alv_grid_1 I have:
* registers the event handlers
SET HANDLER ob_event_receiver_1->toolbar
ob_event_receiver_1->user_command
ob_event_receiver_1->print_top_of_page
ob_event_receiver_1->hotspot_click
ob_event_receiver_1->double_click
ob_event_receiver_1->onf4
ob_event_receiver_1->data_changed
ob_event_receiver_1->before_user_command <-This is the one that you need
ob_event_receiver_1->after_user_command FOR ob_gui_alv_grid_1 .
*----------------------------------------------------------------------*
Regards.