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: 

ALV Grid User Action

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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