Hide ALV toolbar buttons
REPORT ZSAPN_ALV_FUNCTIONS.
DATA: IT_MARA TYPE TABLE OF MARA,
WA_MARA TYPE MARA.
DATA : FUN TYPE TABLE OF RSEUL_FUN.
DATA : WA_FUN LIKE LINE OF FUN.
DATA : IT_EXCLUDE TYPE SLIS_T_EXTAB,
WA_EXCLUDE TYPE SLIS_EXTAB.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE IT_MARA UP TO 50 ROWS.
CALL FUNCTION 'RS_CUA_GET_STATUS_FUNCTIONS'
EXPORTING
LANGUAGE = 'E'
PROGRAM = 'SAPLKKBL'
STATUS = 'STANDARD_FULLSCREEN'
TABLES
FUNCTIONS = FUN.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
*&---------------------------------------------------------------------*
* FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
*&---------------------------------------------------------------------*
LOOP AT FUN INTO WA_FUN. "loop through all functions
IF WA_FUN-FCODE EQ '&F03' OR WA_FUN-FCODE EQ '&F15' OR WA_FUN-FCODE EQ '&F12'. "don`t add back, exit, stop functions
ELSE.
WA_EXCLUDE-FCODE = WA_FUN-FCODE. "add all remaining
APPEND WA_EXCLUDE TO IT_EXCLUDE.
CLEAR WA_EXCLUDE.
ENDIF.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_STRUCTURE_NAME = 'MARA'
IT_EXCLUDING = IT_EXCLUDE "exclude functions
TABLES
T_OUTTAB = IT_MARA. "MARA table data
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.