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: 

Events in ALV Using OO ...

Former Member
0 Kudos

I wrote an ALV using OO . My problem is that i can't control the events for Hotspot , Double Click etc .

Look my code please to find the problem.

&----


*& Report YDP_ALV_USING_OO

*&

&----


*&

*&

&----


REPORT YDP_ALV_USING_OO.

INCLUDE <CL_ALV_CONTROL>.

----


  • CLASS lcl_event_handler DEFINITION

----


*

----


CLASS LCL_EVENT_HANDLER DEFINITION .

PUBLIC SECTION .

METHODS:

*DOUBLE-CLICK CONTROL

HANDLE_DOUBLE_CLICK

FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID

IMPORTING E_ROW E_COLUMN ES_ROW_NO,

*Hotspot click control

HANDLE_HOTSPOT_CLICK

FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID

IMPORTING E_ROW_ID

E_COLUMN_ID

ES_ROW_NO ,

*To implement user commands

HANDLE_USER_COMMAND

FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID

IMPORTING E_UCOMM .

ENDCLASS. "lcl_event_handler DEFINITION

----


  • CLASS lcl_event_handler IMPLEMENTATION

----


*

----


CLASS LCL_EVENT_HANDLER IMPLEMENTATION .

*Handle Double Click

METHOD HANDLE_DOUBLE_CLICK .

PERFORM HANDLE_DOUBLE_CLICK USING E_ROW

E_COLUMN

ES_ROW_NO.

ENDMETHOD . "handle_double_click

*Handle Hotspot Click

METHOD HANDLE_HOTSPOT_CLICK .

PERFORM HANDLE_HOTSPOT_CLICK USING E_ROW_ID

E_COLUMN_ID

ES_ROW_NO .

ENDMETHOD . "handle_hotspot_click

*--Handle User Command

METHOD HANDLE_USER_COMMAND .

PERFORM HANDLE_USER_COMMAND USING E_UCOMM .

ENDMETHOD. "handle_user_command

ENDCLASS . "lcl_event_handler IMPLEMENTATION

........

........

........

&----


*& Form handle_hotspot_click

&----


  • text

----


  • -->I_ROW_ID text

  • -->I_COLUMN_ID text

  • -->IS_ROW_NO text

----


FORM HANDLE_HOTSPOT_CLICK USING I_ROW_ID TYPE LVC_S_ROW

I_COLUMN_ID TYPE LVC_S_COL

IS_ROW_NO TYPE LVC_S_ROID.

READ TABLE ITAB INDEX IS_ROW_NO-ROW_ID .

IF SY-SUBRC = 0 AND I_COLUMN_ID-FIELDNAME = 'REWARD' .

BREAK DFREARAS.

ENDIF .

ENDFORM . "handle_hotspot_click

&----


*& Form handle_double_click

&----


  • text

----


  • -->I_ROW text

  • -->I_COLUMN text

  • -->IS_ROW_NO text

----


FORM HANDLE_DOUBLE_CLICK USING I_ROW TYPE LVC_S_ROW

I_COLUMN TYPE LVC_S_COL

IS_ROW_NO TYPE LVC_S_ROID.

BREAK DFREARAS.

READ TABLE ITAB INDEX IS_ROW_NO-ROW_ID .

IF SY-SUBRC = 0 AND I_COLUMN-FIELDNAME = 'COMPL_NO' .

BREAK DFREARAS.

ENDIF .

ENDFORM . "handle_double_click

Please help ...

1 REPLY 1

Former Member
0 Kudos

THANKS EVERYONE ....

I FOUND IT ...