Skip to Content

I want to know how to hide or grayed out summation button from the toolbar in OOP alv using cl_gui_alv_grid class?

I am using cl_gui_alv_grid class for OOP alv and my requirement is to grayed out the summation button from the toolbar,can anyone suggest me how I can do it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on May 02, 2012 at 08:01 AM

    You have to manage event handle_toolbar of cl_gui_alv_grid. (you will get a reference to cl_alv_event_toolbar_set class interface, manage attrinutes mt_toolbar internal table )

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2012 at 09:14 AM

    Hi,

    we can disable the button in ALV.

    Please refer the below link:

    http://www.saptechies.com/disable-some-standard-buttons-from-alv-display/

    Thanks,

    Lakshmi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 02, 2012 at 09:15 AM

    Use the below code.

    data: lt_exclude type ui_functions,

    ls_exclude type ui_func.

    *-- Exclude button

    ls_exclude= cl_gui_alv_grid=>mc_mb_sum. " Menu sum

    append ls_exclude to lt_exclude.

    ls_exclude= cl_gui_alv_grid=>mc_mb_subtot. " Menu sub total

    append ls_exclude to lt_exclude.

    .

    .

    .

    .

    .

    *-- Include the above internal table as below

    call method obj_grid->set_table_for_first_display

    exporting i_structure_name = 'ZSTR'

    is_layout = ls_layout

    is_variant = ls_variant

    i_save = 'A'

    it_toolbar_excluding = lt_exclude

    changing it_outtab = lt_outtab

    it_fieldcatalog = lt_fieldcatalog.

    ----------------------------------------

    Add a comment
    10|10000 characters needed characters exceeded


    • wa_exclude

      = cl_gui_alv_grid => mc_fc_sum . " Menu sum

      append wa_exclude to it_exclude.

      clear : wa_exclude.


      wa_exclude

      = cl_gui_alv_grid => mc_fc_subtot . " Menu sub total

      append wa_exclude to it_exclude.

      clear : wa_exclude.


      wa_exclude

      = cl_gui_alv_grid => mc_fg_sort . " Menu sort.

      append wa_exclude to it_exclude.

      clear : wa_exclude.


      wa_exclude

      = cl_gui_alv_grid => mc_mb_filter . " Menu filter.

      append wa_exclude to it_exclude.

      clear : wa_exclude.

      This is how I have done it and then I passed it_exclude (internal table ) to set_table_for_first_display .

      But it is not working.Still buttons are getting displayed.

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.