03-04-2021 8:33 AM
Hi Experts
In the bellow screenshot there are two buttons. Now as business requirement is changed, I need hiden buttons by permission.
IE. When I open it and I will find the two buttons.The others don't find it.
Thanks in advance.
03-04-2021 8:52 AM
SET PF-STATUS has an EXCLUDING addtion - check the ABAP documentaiton for details.
You need something like:
DATA exclusions TYPE STANDARD TABLE OF okcode.
AUTHORITY-CHECK for_button_1...
IF sy-subrc IS NOT INITIAL.
INSERT c_okcode_for_button_1 INTO TABLE exclusions.
ENDIF
AUTHORITY-CHECK for_button_2...
IF sy-subrc IS NOT INITIAL.
INSERT c_okcode_for_button_2 INTO TABLE exclusions.
ENDIF.
SET PF-STATUS 'MYSTATUS' EXCLUDING exclusions.
03-04-2021 8:52 AM
SET PF-STATUS has an EXCLUDING addtion - check the ABAP documentaiton for details.
You need something like:
DATA exclusions TYPE STANDARD TABLE OF okcode.
AUTHORITY-CHECK for_button_1...
IF sy-subrc IS NOT INITIAL.
INSERT c_okcode_for_button_1 INTO TABLE exclusions.
ENDIF
AUTHORITY-CHECK for_button_2...
IF sy-subrc IS NOT INITIAL.
INSERT c_okcode_for_button_2 INTO TABLE exclusions.
ENDIF.
SET PF-STATUS 'MYSTATUS' EXCLUDING exclusions.
03-10-2021 1:49 AM
Hi Matthew
When I try to use it as your method. But I don't know how define authorization object ? Thanks.
03-10-2021 6:40 AM
That's covered in help.sap com and many online blogs and tutorials.
Often though, you should be using an existing object. Ask your security team or functional team
03-10-2021 7:08 AM
https://blogs.sap.com/2014/10/09/basic-understanding-of-roles-and-authorization/
I find the blog in SAP community.