2009 Mar 10 6:01 AM
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
2009 Mar 10 12:01 PM
2009 Mar 10 6:02 AM
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
2009 Mar 10 6:07 AM
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
2009 Mar 10 6:08 AM
2009 Mar 10 7:20 AM
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
2009 Mar 10 11:54 AM
2009 Mar 10 12:01 PM