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: 

Missing ICONs for ALV toolbar menuitems (btn-type 2)

marco_weienseel
Explorer
0 Kudos

Hello,

i have added a custom menu button (button type 2) to an ALV toolbar using the following code.

action-handler-method: "on_toolbar FOR EVENT toolbar OF cl_gui_alv_grid"


    DATA: ls_toolbar TYPE stb_button.

    CLEAR ls_toolbar.
    MOVE 'TEST' TO ls_toolbar-function.
    MOVE icon_change_order TO ls_toolbar-icon.
    MOVE 'moep'(110) TO: ls_toolbar-quickinfo,
                                                  ls_toolbar-text.
    MOVE 2 TO ls_toolbar-butn_type.
    MOVE space TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.

So far, so good, but when i add menu entries to the menu button their ICON is not displayed.

Am i doing something wrong, or is it a known error, that this function is not working?

Because i've never seen an SAP-Standard ALV that had icons for ALV toolbar menu button items.

The Menu Items of the SAP-Standard Menu Button "Layout" for example don't have any icons either.

Here the coding i use to add menuitems.

action-handler-method: "on_menu_button FOR EVENT menu_button OF cl_gui_alv_grid"


  IF e_ucomm = 'TEST.
          CALL METHOD e_object->add_function
            EXPORTING
              fcode = 'TEST2'
              text  = 'meep'(132)
              icon  = icon_mail.

...
  ENDIF.

Now my ALV Toolbar has the new Menu Button with 1 menuitem, that menuitem should be displayed with "ICON_MAIL", but isn't. I also tried using @1S@ and @T_MAIL@.

Would be great if anyone could help me,

thanks.

3 REPLIES 3

Former Member
0 Kudos

Hi Marco,

the code which you posted should be corrected.

Sorry for my question, but I can't watch all your code.

Have you triggered the event toolbar by 'SET HANDLE.......'?

0 Kudos

Hello FCannavo,

thanks for you answer.

Yes i did set the action handlers.

The coding i posted are only the parts of the programm, which i considered essential.

The menu-button is displayed and also contains the menu-items, i can click the menu-items, the fcode is processed and everything works fine, only the ICONs for the menu-items are missing.

Former Member
0 Kudos

Hi Marco,

Add the ICON type-pool to the forward declaration of the handler class ( or the <ICON> include if a local class ) you can then use the icon name as defined in them. i.e. ICON_CHANGE.