Skip to Content
author's profile photo Former Member
Former Member

Menu - Right click on column header ?

Hi everyone,

does anyone know how to disable a right-click menu in ALV (CL_GUI_ALV_GRID).

I have disabled the toolbar, but right-clicking on column header displays a menu.

When choosing any menu function, the program crashes.

I see there is a protected event of CLICK_COL_HEADER in CL_GUI_ALV_GRID.

Is there a way to disable that menu or handle it somehow?

Thanks in advance!


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 05, 2009 at 02:53 PM


    Try using event context_menu_request , then handle it appropriately like i.e.

    "class definition
    data o_ct_menu TYPE REF TO cl_ctmenu. 
    methods: handle_context_menu_request FOR EVENT context_menu_request OF cl_gui_alv_grid
                                          IMPORTING e_object.
     METHOD handle_context_menu_request .
        CALL METHOD e_object->clear.
        "add new function
        CALL METHOD e_object->add_function
            fcode = 'CNTX'
            text  = 'Refresh screen'
            icon  = '@0J@'.
        o_ct_menu = e_object.
        LEAVE TO SCREEN 100.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.