ALV Toolbar needs to remove button

If you need to remove the button from Oops ALV such as addition etc you can use the below code which will help in removing the buttons from the toolbar.

DATA : ls_exclude TYPE ui_func,
lt_exclude TYPE ui_functions.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
APPEND ls_exclude TO lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_select_all.
APPEND ls_exclude TO lt_exclude.

CALL METHOD c_alvgd2->set_table_for_first_display
EXPORTING
is_layout = gs_layout2
it_toolbar_excluding = lt_exclude
CHANGING

Leave a Reply

Your email address will not be published. Required fields are marked *