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

can I use authorization objects in a program?

Former Member
0 Likes
478

can I use authorization objects in a program? if so how?

Thanks in advance.

4 REPLIES 4
Read only

suresh_datti
Active Contributor
0 Likes
457

Yes.. usiing the AUTHORITY-CHECK OBJECT statement.. pl see the following <a href="http://help.sap.com/saphelp_47x200/helpdata/EN/fc/eb3ba5358411d1829f0000e829fbfe/frameset.htm">SAP Help</a>

~Suresh

Read only

Former Member
0 Likes
457

THANKS SURESH.

Read only

messier31
Active Contributor
0 Likes
457

HI Nagini,

Yes we can definitely do this using AUTHORITY-CHECK..

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

<b>AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.</b>

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

When this happens, the system checks the authorization profiles in the user’s master record for the appropriate authorization object (S_TRVL_BKS). If the authorization is found and it contains the correct values, the check is successful.

The system administrator has defined the following authorizations for the authorization object S_TRVL_BKS:

S_TRVL_CUS1 with the following values:

  • for customer type ( CUSTTYPE field) and

03 for activity (field: ACTVT).

Users with this authorization can display all customer bookings (activity 03 = display).

S_TRVL_CUS2 with the following values:

B for customer type ( CUSTTYPE) and

02 for activity (ACTVT).

Users with this authorization can change all business customers (activity 02 = change).

When assigning profiles, the system administrator gave different authorizations to different users.

User Miller has been assigned a profile containing both of these authorizations (S_TRVL_CUS1 and S_TRVL_CUS2). Miller can therefore change bookings for business customers.

User Meyers on the other hand, is only authorized to display the records (S_TRVL_CUS1) and therefore cannot change bookings.

Hope this helps you..

Enjoy SAP.

Pankaj Singh

Read only

Former Member
0 Likes
457

THANKS