09-30-2009 9:05 AM
hi all,
i have set hotspot in oo alv for column1. now i would like to trigger hotspot_click event when i click the value in column1 field.
i have defined a local class 'l_class_event' and defined a method 'handle_hotspot_click for event hotspot_click' with necessary parameters.
i have implemented the class and inside the handle_hotspot_click method i have called a perform with necessary parameters. inside the perform i have my code that needs to be triggered when column1 field value is been clicked.
i have instantiated a object g_handler of type 'l_class_event' and used set handler for my alv object. also before instantiating and setting the handler i have a statement calling screen 600 (screen to display my alv). i dont know what is missing in my approach but my event is not getting triggered. is there any specfic place where i have to write my set handler statement?
kindly help me with this issue
regards
Mano
09-30-2009 9:08 AM
09-30-2009 9:08 AM
09-30-2009 9:24 AM
hi max,
here is the code,
class l_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_column_id es_row_no.
ENDCLASS.
CLASS l_event_handler IMPLEMENTATION.
method handle_hotspot_click.
PERFORM handle_hotspot_click USING e_column_id es_row_no .
ENDMETHOD.
ENDCLASS.
start-OF-SELECTION.
data g_handler type REF TO l_event_handler.
CREATE OBJECT g_handler.
call screen 600.
set HANDLER g_handler->handle_hotspot_click for alv_grid.
form HANDLE_HOTSPOT_CLICK using p_e_column_id
p_es_row_no type lvc_s_roid.
READ TABLE it_header INTO wa_header INDEX p_es_row_no-row_id.
endform.
regards
mano
09-30-2009 9:45 AM
Hi,
Put the SET HANDLER statement in PBO of screen 600, just after the statement where you create instance of alv_grid
Regards
09-30-2009 10:00 AM
Hi
Yes Ravi is right
U need to insert the code to set the event just after creating the instance for the grid.
I suppose u create the object for the grid in PBO of screen 600, so u need to put "set HANDLER g_handler->handle_hotspot_click for alv_grid" there.
Max
09-30-2009 11:48 AM
hi ravi,
when i try to put the set handler statement under pbo event in flow logic of screen 600, i am getting syntax error stating 'set is unknown'.
kindly help me.
regards
Mano
09-30-2009 11:50 AM
Hi,
Not in flowlogic.
Put it after CREATE OBJECT alv_grid ......
Regards
09-30-2009 11:52 AM