05-28-2008 5:01 PM
Hi Everybody,
I am using a Custom Container to load the ALV into it.
I have placed a custom button in the ALV status.
I want to capture the user action, how can we do that.
There are 2 in the Grid.Namely Sales Order and Material Number.
When I place the cursor on the Sales Order and click on the button it must display VA03
and do the same with the Material Number.
Can some tell me how to do that?
Please help.Its urgent.
Thanks,
Shashi Devi.
05-28-2008 5:19 PM
FORM handle_toolbar USING i_object TYPE REF TO cl_alv_event_toolbar_set .
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 'EXCH' TO ls_toolbar-function. "#EC NOTEXT
MOVE 2 TO ls_toolbar-butn_type.
MOVE icon_calculation TO ls_toolbar-icon.
MOVE 'Payment in Other Currencies'(202) TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled. "#EC NOTEXT
APPEND ls_toolbar TO i_object->mt_toolbar.
ENDFORM
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
*To add new functional buttons to the ALV toolbar
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive ,
ENDCLASS.
CLASS lcl_event_handler IMPLEMENTATION .
*Handle Toolbar
METHOD handle_toolbar.
PERFORM handle_toolbar USING e_object e_interactive .
ENDMETHOD .
ENDCLASS.
DATA gr_event_handler TYPE REF TO lcl_event_handler .
.. ..
*--Creating an instance for the event handler
CREATE OBJECT gr_event_handler .
*--Registering handler methods to handle ALV Grid events
SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid .
Reward if find useful
05-28-2008 5:19 PM
FORM handle_toolbar USING i_object TYPE REF TO cl_alv_event_toolbar_set .
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 'EXCH' TO ls_toolbar-function. "#EC NOTEXT
MOVE 2 TO ls_toolbar-butn_type.
MOVE icon_calculation TO ls_toolbar-icon.
MOVE 'Payment in Other Currencies'(202) TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled. "#EC NOTEXT
APPEND ls_toolbar TO i_object->mt_toolbar.
ENDFORM
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
*To add new functional buttons to the ALV toolbar
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive ,
ENDCLASS.
CLASS lcl_event_handler IMPLEMENTATION .
*Handle Toolbar
METHOD handle_toolbar.
PERFORM handle_toolbar USING e_object e_interactive .
ENDMETHOD .
ENDCLASS.
DATA gr_event_handler TYPE REF TO lcl_event_handler .
.. ..
*--Creating an instance for the event handler
CREATE OBJECT gr_event_handler .
*--Registering handler methods to handle ALV Grid events
SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid .
Reward if find useful