Try the code bellow.
You also have to set the fieldcat-hotspot field to 'X' in the fieldcatalog for the column you want to enable clicking.
There is also a method for double click, as far as I remember it works very similar way...but I always use hotspot_click.
I've just found it: check demo BCALV_GRID_02
Incho
*eject
----
CLASS cl_event_receiver DEFINITION
----
class lcl_event_receiver: local class to handle event HOTSPOT_CLICK
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id.
ENDCLASS. "lcl_event_receiver DEFINITION
----
CLASS lcl_event_receiver IMPLEMENTATION
----
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_hotspot_click.
READ TABLE it_rseg INDEX e_row_id-index INTO wa_rseg.
CASE e_column_id-fieldname.
*--> Display Invoice
WHEN 'BELNR'.
IF wa_rseg-belnr <> space.
SET PARAMETER ID 'RBN' FIELD wa_rseg-belnr.
SET PARAMETER ID 'GJR' FIELD wa_rseg-gjahr.
CALL TRANSACTION tcode_mir4 AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*=======================================================================
Add a comment