Application Development and Automation 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: 
Read only

Custom Pushbutton in std toolbar with classical ALV grid

Former Member
0 Likes
914

Hi,

I need to add a pushbutton(not an icon) in the std ALV tool bar.I know the method of adding a custom icon in the std ALV tool bar.But i need to add a custom pushbutton with custoom text.

Also im using the FM "REUSE_ALV_GRID_DISPLAY" for displaying the ALV grid.

Hi,

I need to add a pushbutton(not an icon) in the std ALV tool bar.I know the method of adding a custom icon in the std ALV tool bar.But i need to add a custom pushbutton with custoom text.

Also im using the FM "REUSE_ALV_GRID_DISPLAY" for displaying the ALV grid.

4 REPLIES 4
Read only

Former Member
0 Likes
791

Hi.

Just go to you Status GUI, enter a function code in any empty cell, and double click on it.

Then choose 'static text', and enter a Function text, Icon text, and Info text. If you want an icon on your pushbutton, also enter an Icon name. That´s all.

Regards,

F.S.A.

Read only

Former Member
0 Likes
791

Hi,

This is to add custom ICON.But i need to add a custom "push button".Can anyone pls explain the steps for that.

Read only

0 Likes
791

You can not add pushbuttons unless you switch to ALV OO.

In that case, take some sample code to help you:

CLASS cl_event_receiver DEFINITION.

PUBLIC SECTION.

DATA: ucomm TYPE sy-ucomm.

METHODS handle_toolbar_set FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive.

METHODS handle_user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

CLASS cl_event_receiver IMPLEMENTATION.

METHOD handle_user_command.

CASE e_ucomm.

WHEN text-024.

PERFORM upload_id.

WHEN OTHERS.

ENDCASE.

ENDMETHOD.

METHOD handle_toolbar_set.

append a separator to normal toolbar

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

MOVE :text-032 TO ls_toolbar-function,

function code of the push button

text-033 TO ls_toolbar-text.

text that will be displayed on the push button

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD.ENDCLASS.

*set even handlers

SET HANDLER event_receiver1->handle_toolbar_set FOR g_grid1.

SET HANDLER event_receiver1->handle_user_command FOR g_grid1.

And remember saying "thanks" everytime you receive help, even if it´s not really helpfull.

Regards,

F.S.A.

Read only

Former Member
0 Likes
791

Hi,

As u know how to add a custom icon in ALV toolbar. u can also add a custom pushbutton in ALV with only text.

when defining the custom button in PF status in Menu Painter.

dont give the Icon name.

and it will be done...

regards

Sukriti....