Defining a Context Menu 

Use

The ALV Grid Control uses the context menu and assigns standard functions to it. Depending on the context, you can add self-defined functions to this menu and hide or disable preset functions.

Integration

The context menu is an instance of class CL_CTMENU . If event CONTEXT_MENU_REQUEST is triggered by the user, event parameter E_OBJECT contains a reference to the standard context menu.

See also report BCALV_GRID_06 in development class SLIS .

Features

You can change this menu as follows:

CALL METHOD E_OBJECT->ADD_FUNCTION
            EXPORTING FCODE = 'DELE'
            TEXT = TEXT-003. "Delete

With methods enable_functions and show_functions you can enable or display the relevant functions again.

You read the function codes for self-defined functions at event user_command.