!--a11y-->Creating a Context Menu
Use
You can use the entries from a context menu that you define in the Menu Painter to construct a context menu on a screen or list using the method LOAD_GUI_STATUS from the global class CL_CTMENU.
Procedure
To create a context menu from the Object Navigator:
- Select Program objects and choose Edit.
- Enter the name of the ABAP program.
- Choose GUI Status and enter the name of your context menu.
This is the name that you will pass to the importing parameter STATUS of the method LOAD_GUI_STATUS.
- Choose Create.
The Create Status dialog box appears, containing fields for the status attributes.
- Enter a short text.
- Select the status type context menu.
- Choose Continue.
The work area for the context menu appears.
- In the Code column, enter a function code, and under Text, the corresponding text for the menu entry.
- Repeat step 8 for each further function you want to add to your context menu.
- If you want to enter a separator, choose Edit ®
Insert ®
Separator.
- If you want to create a cascading menu, leave the Code field empty, and enter the menu text for the cascading menu. You can then open it by double-clicking, and enter the required entries.
Example:
Result
You have created a set of functions that can be used as a template for constructing a context menu.
For information about how to define the relevant processing logic in ABAP, refer to
Context Menus.