Context menus (right mouse key, SHIFT F10) are shortcuts for functions that are frequently used.They can be used to display context-sensitive menus. The context is defined by the position (cursor for SHIFT F10, mouse location for right mouse key) where the user called the context menu. If needed, you can specify the context more precisely with the displayed contents. This permits the user to select functions that are relevant for the current context using the context menu.You define whether a context menu should be offered when you create a screen object (screens, input fields, table controls, boxes, ...). When the user selects a context menu on an object, an event mechanism (as understood by ABAP objects) calls a certain subroutine in the application program.The program is assigned a menu reference. The program uses this menu reference to build the display menu. Menus defined with the Menu Painter and dynamic menus can be used here.
After the user executes a menu function, the application program regains control and can react to the user input.Context menus are assigned to output fields. When you assign a context menu to a box, table control or screen (normal or sub screen), all the subordinate output fields that do not have a context menu inherit that one.You can create a context menu from within the object list of the Object Navigator. Position the cursor on GUI status and right-click. The Object Navigator automatically opens the Menu Painter.
Of course you can also create a context menu directly in the Menu Painter.
A context menu is a special GUI status. Assign it a name, a descriptive text and status type Context menu.In a context menu you can link any function codes and function texts. In particular, you can take advantage of your screen push buttons. The functions already provided in the interface can be used as an F4 input help.
- The link technique ensures consistent context menus in large applications.
- You should observe the following rules when designing context menus.
- Do not use any functions that cannot be found elsewhere in the system (push buttons or interface).
- Avoid using more than two hierarchy levels in context menus.
- Do not use more than 10 entries, but map all the available push buttons.
- Use separators to structure the context menu optically.
- Place object-specific statements at the beginning of the menu.
Pressing the right mouse key triggers a callback routine in your program. You can create this callback routine in your application program with forward navigation. It is named ON_CTMENU_
ERP sap Business process cycle for abaper