Question:
Hi,
I have written a report using ALV objects. I have created a hotspot for one of the columns, how can I display an internal table on selecting the hotspot.
Any sample code would be appreciated.
Thanks in advance
Answer:
You need a event handler which processes a method on 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.
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_hotspot_CLICK.
* do anything
ENDMETHOD.
ENDCLASS.
The event handler must be declaered, instanciated and registered on grid's event.
data event_receiver type ref to lcl_event_receiver.
data grid type ref to cl_gui_alv_grid.
create object grid
[etc....]
create object event_receiver.
set handler event_receiver->handle_hotspot_click for grid.