HIDING TOOL BAR IN ALV REPORT OUTPUT :
This program is used to display ALV report output without application tool bar buttons.
*&---------------------------------------------------------------------*
*& Report ZR_HIDE_TOOLBAR_IN_ALV_OUTPUT
*&
*&---------------------------------------------------------------------*
REPORT ZR_HIDE_TOOLBAR_IN_ALV_OUTPUT.
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 10 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'.
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_STRUCTURE_NAME = 'MARA'
IT_EXCLUDING = IT_EXCLUDE "exclude functions
TABLES
T_OUTTAB = IT_MARA.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
OUTPUT:
This program is used to display ALV report output without application tool bar buttons.
*&---------------------------------------------------------------------*
*& Report ZR_HIDE_TOOLBAR_IN_ALV_OUTPUT
*&
*&---------------------------------------------------------------------*
REPORT ZR_HIDE_TOOLBAR_IN_ALV_OUTPUT.
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 10 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'.
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_STRUCTURE_NAME = 'MARA'
IT_EXCLUDING = IT_EXCLUDE "exclude functions
TABLES
T_OUTTAB = IT_MARA.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
OUTPUT: