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: 

Text on pushbutton

Former Member
0 Kudos

Hi All,

In my current report i am using ALV TREE by using cl_gui_alv_tree.

in which i have added a pushbutton & added functionality to them ,but i want a text on that push button.

Can anyone help me to get the text on the push button.

Thanks in advance.

Regards,

Tarak

2 REPLIES 2

MarcinPciak
Active Contributor
0 Kudos

In your method for handling toolbar button do this coding.


"somewhere in class define a method for hadling toolbar
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
                      IMPORTING e_object e_interactive,
...
"then in implemenation part 
  METHOD handle_toolbar.
    DATA: ls_toolbar TYPE stb_button.
" append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type.
    APPEND ls_toolbar TO e_object->mt_toolbar.
" append an icon to 
    CLEAR ls_toolbar.
    MOVE 'INS' TO ls_toolbar-function.        "here goes your funtion code
    MOVE icon_insert_multiple_lines TO ls_toolbar-icon.  "here name of the icon to dsiplay 
    MOVE text-tl1 TO ls_toolbar-quickinfo.    "here add your text as quickinfo
    MOVE text-tl2 TO ls_toolbar-text.          "here goes your text on pushbutton
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
  ENDMETHOD.     

Former Member
0 Kudos

Try like this.

CONCATENATE '@FN@'  'My Buttton' INTO p_button  SEPARATED BY space. " This will add a icon  + text to the button.

-Aman