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: 

Event not raised in ALV grid

Former Member
0 Kudos
280

Hi ,

I am trying to implement a hotspot for a column in my ALV grid.I have enabled hotspot for the field via fieldcatalog.I am using the class cl_gui_alv_grid for the ALV grid display.

And then have done the following steps :

  • LOCAL CLASSES: Definition

****************************************************************

*===============================================================

  • class lcl_event_receiver: local class to

  • define and handle own functions.

  • Definition:

  • ~~~~~~~~~~~

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

handle_hotspot_click

FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no.

ENDCLASS.

  • lcl_event_receiver (Implementation)

*===================================================================

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_hotspot_click .

PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no.

ENDMETHOD.

ENDCLASS.

----


  • MODULE pbo_100 OUTPUT

----


*

----


DATA : gr_event_receiver TYPE REF TO lcl_event_receiver.

*Creating an instance for the event handler

CREATE OBJECT gr_event_receiver.

*--Registering handler methods to handle ALV Grid events

SET HANDLER gr_event_receiver->handle_hotspot_click for FOR ALL INSTANCES.

&----


*& Form handle_hotspot_click

&----


  • text

----


  • -->P_E_ROW_ID text

  • -->P_E_COLUMN_ID text

  • -->P_ES_ROW_NO text

----


form handle_hotspot_click using p_e_row_id type lvc_s_row

p_e_column_id type lvc_s_col

p_es_row_no type lvc_s_roid.

data : gs_bb like line of gt_bb .

read table gt_bb into gs_bb index p_e_row_id.

if sy-subrc = 0 and p_e_column_id-fieldname = 'BELEG'.

CALL TRANSACTION 'ZPAMU03' AND SKIP FIRST SCREEN.

endif.

endform. " handle_hotspot_click

However the event is not raised.When i click on the hotspot , it doesn't invoke the debugger.I am sure I am missing out something.Kindly suggest.Thanks in advance.

3 REPLIES 3

Former Member
0 Kudos
81

hey ,

Check the sample program

BCALV_TEST_GRID in Package SLIS -using class /methods

Whiel debugging ,please make sure you check the checkbox - " Hotspot for primary keys" in selection screen.

You will get to know what you missed in your program.

Thanks!Bob

Former Member
0 Kudos
81

Hi,

Read gt table contents index row number.

Thanks,

Kalpana

Former Member
0 Kudos
81

The instance of the event handler and registering of the handler events should be done right after the ALV instance is created in the PBO module .That did the trick !Thanks for the suggestions.I am closing the message.