Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hotspot event is not getting triggered

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Can u post the main part of your abap code?

Max

7 REPLIES 7

Former Member
0 Kudos

Hi

Can u post the main part of your abap code?

Max

0 Kudos

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

0 Kudos

Hi,

Put the SET HANDLER statement in PBO of screen 600, just after the statement where you create instance of alv_grid

Regards

0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

Not in flowlogic.

Put it after CREATE OBJECT alv_grid ......

Regards

0 Kudos

thank you ravi and max.