‎2014 Jan 17 4:56 AM
I want to develop a sap abap hr program which contains authorisation objects to restrict the access of data to a particular set of users.
‎2014 Jan 17 5:05 AM
Hi Joince,
a z authorization object will be created by your basis team, where they will assign the respected
tcodes only to those user for which you wants authorization.
You have to write your code logic in your program to validate it.
If it will true then only those user will access that transaction.
You have to code something like this, please change it according to your tcode.
IF SY-TCODE = 'your tcode'.
AUTHORITY-CHECK OBJECT 'Zobject'
ID 'ACTVT' FIELD '01'
id 'ACTVT' field '02'
id 'ACTVT' field '03'
IF SY-SUBRC EQ 0.
ELSE.
MESSAGE 'YOU ARE NOT AUTHORISED FOR THIS Tcode' TYPE 'E'.
ENDIF.
ENDIF.
‎2014 Jan 17 5:05 AM
Hi Joince,
a z authorization object will be created by your basis team, where they will assign the respected
tcodes only to those user for which you wants authorization.
You have to write your code logic in your program to validate it.
If it will true then only those user will access that transaction.
You have to code something like this, please change it according to your tcode.
IF SY-TCODE = 'your tcode'.
AUTHORITY-CHECK OBJECT 'Zobject'
ID 'ACTVT' FIELD '01'
id 'ACTVT' field '02'
id 'ACTVT' field '03'
IF SY-SUBRC EQ 0.
ELSE.
MESSAGE 'YOU ARE NOT AUTHORISED FOR THIS Tcode' TYPE 'E'.
ENDIF.
ENDIF.
‎2014 Jan 17 5:17 AM
Hi,
You want to restrict the data access or report access?
I understand that you have to restrict with the selection screen field level! please be specific your requirement how you want to restrict the access to the users!
‎2014 Jan 17 5:35 AM
There are multiple levels of users with different access levels.I want to restrict the user access according to the authorisation that is given only.
‎2014 Jan 17 5:22 AM
Please check authorization object "P_ORIGN". If you use logical database "PNP" or "PNPCE", then it will take care of authorizations based on values assigned to authorization object in user master.
Regards
‎2014 Jan 17 5:37 AM
Thanks for the reply .could you please explain the concept more elaborately.I am using pnp logical data base.