2011 May 18 10:38 AM
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.
2011 May 18 12:23 PM
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
2011 May 23 2:33 PM
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.
2011 May 23 2:34 PM