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 static method LOAD_GUI_STATUS from the global class CL_CTMENU.
...
1. Open the Repository Browser and navigate to the corresponding program.
2. In the context menu of the program, choose Create ® GUI Status.
3. In the new dialog box, enter a name of the context menu.
This is the name that you pass to the importing parameter STATUS of the method LOAD_GUI_STATUS.
4. Enter a short description and select the Context menu radio button.
5. Choose with the quick info text Continue.
The maintenance screen for the context menu appears.
6. In the Code column, enter a function code, and under Text, enter the corresponding text for the menu entry.
7. If you want to enter a separator, choose Edit ® Insert ® Separator line.
8. 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 on it, and enter the required entries.
The following figure displays an example of a context menu.
You have created a set of functions that can be used as a template for constructing a context menu.
For information about defining the relevant processing logic in ABAP, see Context Menus.