03-19-2010 2:43 PM
Hi,
I have two objects of a cl_gui_alv_grid class, both tied to the same event handler object.
In handling the user_command event of cl_gui_alv_grid, I need to know which one of both grids is actually the one calling. ( I need to know which internal table to edit)
How do I do that as you only receive the sy-ucomm and that's it?
Thanks in advance
03-19-2010 2:48 PM
03-19-2010 2:50 PM
03-22-2010 7:33 AM
I'm not sure but try something like following
MODULE PBO_100.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = CUSTOM_CONTAINER1.
GRID1->SET_NAME( 'GRID1' ).
CREATE OBJECT GRID2
EXPORTING
I_PARENT = CUSTOM_CONTAINER1.
GRID2->SET_NAME( 'GRID2' ).
ENDMODULE.
METHOD HANDLE_USER_COMMAND.
DATA LV_NAME TYPE STRING.
CALL METHOD CUSTOM_CONTAINER1->CUR_EVENT->EVENT_SRC->GET_NAME
RECEIVING
NAME = LV_NAME.
CASE LV_NAME.
WHEN 'GRID1'.
EDIT TABLE 1
WHEN 'GRID2'
EDIT TABLE 2.
ENDCASE.
ENDMETHOD.
03-25-2010 12:51 PM
The obvious was overlooked... you can transfer the "sender" towards a handler.