2023 Dec 18 8:37 AM
Hi,experts how to hide last selection-screen option for some users ( authorization-object )?
it's p-_marc here
2023 Dec 18 8:58 AM
Please [DO NOT post images](https://stackoverflow.com/help/how-to-ask) of code, data, error messages, etc. - copy or type the text into the question.
This question was asked many many times in the forum, LOOP AT SCREEN and MODIFY SCREEN based on SCREEN-GROUP1 (equivalent to MODIF ID). Good luck in searching.
2023 Dec 18 8:59 AM
2023 Dec 18 9:20 AM
Never, ever put conditions like that into your code, unless it's a test code in a very early stage
IF sy-uname = 'RB_ABAP7'.
Authorization objects have to be used instead. I've seen such shortcuts backfiring so many times when RB_ABAP7 user leaves the building and the code doesn't work for their replacements.
2023 Dec 18 9:35 AM
I can't find a user list in authorization-object. How to do it?
2023 Dec 18 9:49 AM
Create an authorization object with SU21 and use it in PBO logic
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_BW_N'.
AUTHORITY-CHECK OBJECT 'Zxxxxx' " created with SU21
ID 'ACTVT' FIELD '03'. " define at least 1 field
IF sy-subrc <> 0.
screen-active = 0.
MODIFY SCREEN.
IF P_BW_N = abap_true. " prevent dump
CLEAR P_BW_N.
P_MARA = abap_true.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Then Admin will create/adapt roles for users with PFCG.
Hint: Attach your authorization object to transaction defintion with SU24 (administrator would like to thank you)
2023 Dec 18 10:01 AM
why i need an authorization object if can just create an role and do select with AGR_USERS table?
i don't have an admin and need to do it for myself.
i've created an authorization object and don't undersrand how to add it to pfcg
As i understand role doesn't create automaticly and i need to do it by myself
2023 Dec 18 10:10 AM
Read some online documentation on Authorization Concept in Abap
Look also at training such as ADM940 Authorization Concept for SAP S/4HANA and SAP Business Suite
Steps
NB: If you link an authorization object with a transaction with SU24, then when you add the transaction to a role with PFCG it will add the authorization to the role.
2023 Dec 18 10:10 AM
How to create authorization objects and how to work with authorizations have been asked and answered many times in the forum too.
What specific issue do you have?