Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authorisation objects in sap abap hr program

Former Member
0 Likes
851

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.

1 ACCEPTED SOLUTION
Read only

former_member187748
Active Contributor
0 Likes
775

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.

5 REPLIES 5
Read only

former_member187748
Active Contributor
0 Likes
776

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.

Read only

Former Member
0 Likes
775

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!

Read only

0 Likes
775

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.

Read only

former_member188827
Active Contributor
0 Likes
775

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

Read only

0 Likes
775

Thanks for the reply .could you please explain the concept more elaborately.I am using pnp logical data base.