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.

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source