
set_static_ctxmenu
Use this method to assign a context menu to a pushbutton for the entire lifetime of the control. When you assign a context menu statically, the system loads it into the frontend control and it remains there after the user has closed it. Normally the system triggers the DROPDOWN_CLICKED event when the user clicks a pushbutton that has a dropdown menu. In your application, you would then assign the context menu to the button, but only for that one occasion. If you assign the context menu statically, it resides at the frontend, and is available each time the user clicks the corresponding pushbutton without you having to reassign it each time.
You should use static context menus in all but the most context-sensitive cases.

Any changes that are made to the context menu during the lifetime of the control are automatically updated at the frontend.
CALL METHOD toolbar->set_static_ctxmenu
EXPORTING fcode = fcode
ctxmenu = ctxmenu
Parameter and Type |
Meaning |
fcode |
Function code of the button to which you want to assign the context menu Note: The button must have the type cntb_btype_dropdown or cntb_btype_menu . |
ctxmenu CL_CTMENU |
Reference variable pointing to the context menu instance you want to assign (see
Context Menus) |