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

Authority Object

Former Member
0 Likes
589

Dear all,

Anyone plese tell me the procedure for creating authority object and implementing it.

Transaction

Steps

Thanks

Senthil

3 REPLIES 3
Read only

Former Member
0 Likes
561

Hi Senthil,

Go to su21 to create the Authority object

Implementing in code

AUTHORITY-CHECK OBJECT 'YTM1SD001'

ID 'ACTVT' FIELD '16'.

IF sy-subrc <> 0.

MESSAGE i003 WITH sy-uname.

STOP.

ENDIF.

Regards

Arun

Read only

Former Member
0 Likes
561

Hello,

Please find the following extract on Authorisation objects -


>

Using SU21 u can create Authorisation Object.

Details to give an authorisation for ABAP PROGRAMS are as follows

The smallest unit against which the check should be run is the authorization

field.

The ABAP command AUTHORITY-CHECK is used for performing authorizaton checks in programs. Before accessing the database the user should carry out an

authorization check which is implemented in the ABAP program. The

AUTHORITY-CHECK statement first checks if the user has the authorization

containing all the required values. Then the code value in the system field

SY-SUBRC is checked. If the required value is available for each

authorization field, the check is successful (SY-SUBRC = 0). If the value is

not 0, then the check is unsuccessful, which means that the user does not

possess the required authorization and an error message will be displayed.

AUTHORITY-CHECK sets SY-SUBRC to 4, 8, 12, 16, 24, 28, 32 or 36 depending on

the cause of the authorization failure, e.g. return code 4 means that the

user does not have the required authorization; SY-SUBRC = 8 means that the

check could not successfully be carried out since not all fields of the

object were specified. The field SUBRC is in the APAB Dictionary SYST. To

address the system field in an ABAP program, the form SY-<fieldname> is

used.

The ABAP syntax of the AUTHORITY-CHECK statement is:

AUTHORITY-CHECK OBJECT '<object>' (which created by you in SU21)

ID '<name1>' FIELD <f1> (fields given in Authorisation object)

???????????

ID '<name10>' FIELD <f10>.

Where <object> is the name of the authorization object that has to be

checked, <name1>,..., <name10> are the authorization fields in the object,

and <f1>,... ,<f10> are the values for which the authorization is to be

checked. If after the field name is entered DUMMY, the check for a

particular field will not be carried out.

Hope it serves your purpose

Regards

Byju

Read only

Former Member
0 Likes
561

Hi,

Tcode for Authority object are

SU20 -


> for authorization field

SU21----


> Authorization Object

SU22----


> Assign Authorization Object

Regards

Gaurav