So, inside the TOOLBAR event of the CL_GUI_ALV_GRID the parameter E_OBJECT has the table MT_TOOLBAR that I can access to change all the buttons manually.
Is there a better way to include/exclude standard buttons in the toolbar than simply creating them like custom-buttons in the toolbar event?
Similar to
REUSE_ALV_GRID_DISPLAYin classCL_GUI_ALV_GRIDthere is also a way.Define a table of type
UI_FUNCTIONSand a work area of typeUI_FUNC:Append the attributes of the functions you want to hide to the table:
The attributes of the standard functions all begin with the prefix
MC_FC_, in addition, there is the prefixMC_MB_for an entire menu in the toolbar.Pass the table using method
set_table_for_first_displaywith parameterit_toolbar_excluding