Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion of total(summation) button in the ALV oops

Former Member
0 Kudos
131

Hi,

I need to remove the Total button in the ALV. For that I'm using the following logic, which is not working. The same logic is working for other buttons.

DATA: l_hide TYPE ui_functions,

l_hide1 TYPE ui_func.

l_hide1 = cl_gui_alv_grid=>mc_fc_sum.

APPEND l_hide1 TO l_hide.

CALL METHOD g_grid->set_table_for_first_display

EXPORTING

is_layout = l_it_layout

it_toolbar_excluding = l_hide

CHANGING

it_outtab = cr_it_outtab

it_fieldcatalog = cr_it_fieldcat

Any pointers on this would be of great help.

Thanks in advance,

Vamsi.

3 REPLIES 3

kesavadas_thekkillath
Active Contributor
0 Kudos
56

Hi,



DATA:container TYPE REF TO cl_gui_custom_container,
     grid TYPE REF TO cl_gui_alv_grid.
DATA:t_mara TYPE TABLE OF mara.
DATA:fun TYPE ui_functions,
     ls_fun TYPE ui_func.

SELECT * FROM mara INTO TABLE t_mara UP TO 10 ROWS.
CALL SCREEN 100.

MODULE list OUTPUT.

  CREATE OBJECT container EXPORTING container_name = 'CONTAINER'.
  CREATE OBJECT grid EXPORTING i_parent = container.

  ls_fun = cl_gui_alv_grid=>mc_fc_maximum. "Pass all these ... it will work
  APPEND ls_fun TO fun.
  ls_fun = cl_gui_alv_grid=>mc_fc_minimum.
  APPEND ls_fun TO fun.
  ls_fun = cl_gui_alv_grid=>mc_fc_subtot.
  APPEND ls_fun TO fun.
  ls_fun = cl_gui_alv_grid=>mc_fc_sum.
  APPEND ls_fun TO fun.

  CALL METHOD grid->set_table_for_first_display
    EXPORTING
      it_toolbar_excluding = fun
      i_structure_name     = 'MARA'
    CHANGING
      it_outtab            = t_mara.

ENDMODULE. "LIST OUTPUT

Former Member
0 Kudos
56

Hi,

I got the solution for this. Along with mc_fc_sum, I passed mc_mb_sum as shown below and got the required result.

l_hide1 = cl_gui_alv_grid=>mc_fc_sum.

APPEND l_hide1 TO l_hide.

l_hide1 = cl_gui_alv_grid=>mc_mb_sum.

APPEND l_hide1 TO l_hide.

Thanks,

Vamsee.

Former Member
0 Kudos
56

found the solution by other sources.