Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

The standard function buttons of ALV grid can be hidded according to the requirment.

Step 1.

For this you have to create an internal table of type UI_FUNCTIONS.

UI_FUNCTIONS is a table type which has the line type UI_func.
UI_FUNC has the domain SYCHAR70.

Step 2.

populate the internal table with the required fields that you want to hide
using a work area of type UI_FUNC.

Step 3.

Pass the internal table to the method set_table_for_first_display
using the parameter it_toolbar_excluding .

REPORT zalv.
DATA:
r_container TYPE REF TO cl_gui_custom_container,
r_grid TYPE REF TO cl_gui_alv_grid.
DATA:
t_sflight TYPE TABLE OF sflight.
DATA:
t_fun TYPE ui_functions,
fs_fun TYPE ui_func.
SELECT * FROM sflight INTO TABLE t_sflight.
CALL SCREEN 100.
*&---------------------------------------------------------------------
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------

MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------

MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------
*& Module HANDLER OUTPUT
*&---------------------------------------------------------------------

MODULE list OUTPUT.CREATE OBJECT
r_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT r_grid
EXPORTING
i_parent = r_container.
fs_fun = cl_gui_alv_grid=>mc_fc_maximum.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fc_minimum.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fc_subtot.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fc_sum.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fg_sort.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fc_filter.
APPEND fs_fun TO t_fun.
fs_fun = cl_gui_alv_grid=>mc_fc_detail.
APPEND fs_fun TO t_fun.
CALL METHOD r_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = t_fun
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = t_sflight.
ENDMODULE. "LIST OUTPUT



Grid display before HIDE:

Grid display after HIDE:

  • No labels