2016 May 25 5:10 PM
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
2016 May 25 6:11 PM
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.
2016 May 25 6:11 PM
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.
2016 May 25 8:23 PM
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
2016 May 25 9:35 PM
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' ).
2016 May 26 12:09 PM
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
2016 May 30 7:40 AM
2016 May 25 6:16 PM