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: 

ALVOM Toolbar menu_button

Former Member
0 Kudos

Hi Experts in ALV-OM,

i try to add a new menu-button to alv-om. (CL_SALV_TABLE), but I don't find the right methods.

The methods

lr_functions = go_alv->get_functions( ).

lr_functions->set_all( abap_true ).

lr_functions->set_group_filter( abap_true ).

supplies standard-menu-buttons, therefore it must be possible to add an own menu_button.

It is possible to add functions with (CL_SALV_FUNCTION_LIST->ADD_FUNCTION), but I can't find the right coding to add an group, all methods I found (set_group, set_item) are protected.

Thanks for your help

Christiane

4 REPLIES 4

Former Member
0 Kudos

Hi Christiane,

If you check in this link [adding functions|http://help.sap.com/saphelp_nw70/helpdata/EN/41/b22041d69ba52fe10000000a155106/frameset.htm], there is a line

In the container display, you are only able to add pushbuttons in the application toolbar. You are not able to generate menu entries.

this made me shift to [CL_GUI_ALV_GRID Toolbar|http://help.sap.com/saphelp_nw70/helpdata/EN/ee/c8e07dd52611d2b468006094192fe3/frameset.htm] for implementing menu-entries function in toolbar...

Cheers,

Jose.

0 Kudos

Hi Jose,

yes I also read that, but I don't want to believe it. If I've no solution till noon, I will take CL_GUI_ALV_GRID.

Thanks

Christiane

naimesh_patel
Active Contributor
0 Kudos

There are methods in the class CL_SALV_FUNCTION which will allow you to set the Group, Icon, Visibility etc for each Function of the Toolbar.

Try like:


  DATA: lt_function TYPE salv_t_ui_func,
        la_function LIKE LINE OF lt_function,
        l_function TYPE string,
        lo_function  TYPE REF TO cl_salv_function.

  lt_function = lr_functions->get_functions( ).

  LOOP AT lt_function INTO la_function.

    l_function = la_function-r_function->get_name( ).

    check l_function = 'MYFUNCTION'.
      lo_function ?= la_function-r_function.
      lo_function->set_group( 'MYGROUP' ).

  ENDLOOP.

Regards,

Naimesh Patel

0 Kudos

Hallo Naimesh,

thanks for your answer, but my first problem ist to create a new menu-button. Do you know, how to do?

Thanks a lot

Christiane