Hi,
you can use the following approach if it's an ALV report.
Data :IT_EXCLUDE
TYPE
SLIS_T_EXTAB,
WA_EXCLUDE
LIKE
LINE
OF IT_EXCLUDE
subroutine to exclude the controls on the ALV Display.
PERFORM
EXCLUDE_TB_FUNCTIONS.
CALL
FUNCTION
'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_REPID
I_CALLBACK_PF_STATUS_SET =
'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND =
'USER_COMMAND'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = FCAT
IT_EXCLUDING = IT_EXCLUDE """" exclude table
IT_EVENTS = I_EVENTS[]
TABLES
T_OUTTAB = IT_ERROR
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS
= 2.
IF
SY-SUBRC <> 0.
MESSAGE
ID SY-MSGID
TYPE
SY-MSGTY NUMBER SY-MSGNO
WITH
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF
.
*
---------------------------------------------------------------------
*
*
Form exclude_tb_functions
*
---------------------------------------------------------------------
*
*
text
*
---------------------------------------------------------------------
*
FORM
EXCLUDE_TB_FUNCTIONS .
if sy-uname = "SAPUSER". user for which you want to disable the button
WA_EXCLUDE-FCODE = C_INFO. " fcode of the button
APPEND
WA_EXCLUDE
TO
IT_EXCLUDE.
CLEAR
WA_EXCLUDE.
endif.
ENDFORM
. "exclude_tb_functions