‎2006 Nov 02 6:09 PM
can I use authorization objects in a program? if so how?
Thanks in advance.
‎2006 Nov 02 6:13 PM
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
‎2006 Nov 02 6:14 PM
‎2006 Nov 02 6:17 PM
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 users 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
‎2006 Nov 03 7:43 PM