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 toolbar button

Former Member
0 Kudos

Hi experts,

i have a requirement to add a button on alv toolbar in new row.

i know the procedure to add a button in alv toolbar.but how to create new second toolbar and adding buttons there.i have no idea on this

i am using class cl_gui_alv_grid.

can u please provide me some sample code

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Sai, i am not sure if what you wnat is really possible.

6 REPLIES 6

Former Member
0 Kudos

hi,

here is sample code

CLASS cl_eventhandler DEFINITION.

PUBLIC SECTION.

METHODS:

handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive,

handle_user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

METHODS:

handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid

IMPORTING er_data_changed e_ucomm.

ENDCLASS. "cl_eventhandler DEFINITION

*class implementation

CLASS cl_eventhandler IMPLEMENTATION.

METHOD handle_toolbar.

DATA: ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 'SAVE' TO ls_toolbar-function.

MOVE icon_print TO ls_toolbar-icon.

MOVE 'Save data' TO ls_toolbar-quickinfo.

MOVE 'Save data' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

CLEAR ls_toolbar.

MOVE 'DISPLAY' TO ls_toolbar-function.

MOVE icon_print TO ls_toolbar-icon.

MOVE 'Display errors' TO ls_toolbar-quickinfo.

MOVE 'Display errors' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

ENDMETHOD. "handle_toolbar

ENDCLASS. "cl_eventhandler IMPLEMENTATION

Former Member
0 Kudos

hi sonia,

thank u for ur reply,

i am doing the same as u mentioned in the code.

but i want to start my buttons in a new line.

Thanks

Sai

Former Member
0 Kudos

Hi Sai,

Kindly go through this link below:

Hope it helps

Regrds

Mansi

Former Member
0 Kudos

hi mansi,

i am not using ALV tree display. i am using Grid display.

i think this link may not be usefull to me.

Thanks

Sai

Former Member
0 Kudos

HI

any ideas.

Former Member
0 Kudos

Sai, i am not sure if what you wnat is really possible.