Skip to Content
0
Former Member
Dec 11, 2009 at 01:33 PM

CL_GUI_ALV_GRID hotspot Problem

116 Views

Hi Experts,

I am having problem while triggering event for HOTSPOT through CL_GUI_ALV_GRID.

Here in my program I am using three public events :

1: DATA_CHANGED

2.DATA_CHANGED_FINISHED

3. HANDLE_HOTSPOT

the first two events are working for Drop Down in ALV. Means if user select any value from drop down then a dialog box will appera to document the data.

The Hotspot is working on one field of LAV. Means if user clicks on this particular field the with SET parameter ID it should take the user to given Transaction Code.

The first condition is working fine. But when I am hitting on the Field which is HOTSPOT enabled then also my code is taking me to .DATA_CHANGED_FINISHED event rather then HANDLE_HOTSPOT. The code for hotspot is as below

METHOD data_changed_finished.

DATA: ls_output LIKE LINE OF gt_output.

IF l_row_id IS INITIAL.

....... mycode

ENDIF.

ENDMETHOD.

METHOD HANDLE_HOTSPOT.

DATA: ls_output like line of gt_output.

DATA : l_columnid TYPE lvc_s_col,

l_roid TYPE lvc_s_roid.

READ TABLE gt_output INTO ls_output INDEX l_roid-row_id.

If sy-subrc = 0 and l_columnid-fieldname = 'LIFNR'.

SELECT SINGLE * FROM LFB1 INTO LFB1 WHERE lifnr = ls_output-lifnr.

SET PARAMETER ID 'LIF' FIELD ls_output-LIFNR.

SET PARAMETER ID 'BUK' FIELD lfb1-BUKRS.

  • SET PARAMETER ID 'GJR' FIELD BKPF-GJAHR..

CALL TRANSACTION 'FK03'.

ENDIF.

ENDMETHOD.

Please guide me that where I am wrong, so that I can finish my code.