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: 

Adding "sub function" to function in ALV toolbar ?

martin_svik2
Participant
0 Kudos

hi there,

see screenshot: the demo program BCALV_GRID_07 has a customer button in the toolbar. It has 2 functions there -> "Überblick" and "Flüge". This is done with the add_function method in class CL_CTMENU.

So far, so good: i have the requirement of an "Sub Menu" inside the dropdown. E.g. I have function "Überblick": i want to enter sub-entries for "Überblick".  There are methods like "add_menu" and "add_submenu" in the class CL_CTMENU, but i don't know how i can use them in the toolbar in ALV.

any ideas ?

br Martin

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

You first create another context menu instance, with all your sub functions, and you link this menu to your current context menu in a new line using method ADD_SUBMENU.

6 REPLIES 6

Sandra_Rossi
Active Contributor
0 Kudos

You first create another context menu instance, with all your sub functions, and you link this menu to your current context menu in a new line using method ADD_SUBMENU.

0 Kudos

hi sandra,

i am not sure what you mean with "create another context menue instance, with all your sub functions" ?

is there any example coding somewhere ?

br Martin

0 Kudos

Simply:

  CREATE OBJECT lo_ssctmenu.
  lo_ssctmenu->add_function( text = 'submenu1' fcode = 'F1' ).
  lo_ssctmenu->add_function( text = 'submenu2' fcode = 'F2' ).
  lo_ctmenu->add_submenu( menu  = lo_ssctmenu
                          text  = 'submenu' ).

0 Kudos

You also have an example that shows it's possible - although I think it's creating the secondary menu based on an existing GUI status contextual menu (my example above is about creating it from scratch) -> program SAPTOOLBAR_DEMO1

0 Kudos

hi sandra,

thank you very much, it is working !

0 Kudos

Please check the event menu_button.

Regards,

Shashi