Application Development 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: 

Authorization object

Former Member
0 Kudos

I have to create a program which should run for a particular user. Can anyone tell how to give authorization for that particular user so that particular user should only run the program if other run the program it should display the error message

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Checking User Authorizations in your ABAP Program

How to set Authorization to an ABAP Programs?

Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.

If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.

This means you have to allocate an authorization object in the definition of the transaction.

For example:

program an AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT <authorization object>

ID <authority field 1> FIELD <field value 1>.

ID <authority field 2> FIELD <field value 2>.

...

ID <authority-field n> FIELD <field value n>.

The OBJECT parameter specifies the authorization object.

The ID parameter specifies an authorization field (in the authorization object).

The FIELD parameter specifies a value for the authorization field.

The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can create a new authorization object...And then use that in your program..

Check this link for creating authorization object..

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a...

Thanks,

Naren

0 Kudos

(you will need the help of basis guy to create an authorization object and assign it to a particular user. following is the code that u will need to write to check for authorization before ur program executes.

FORM chk_auth .

CONSTANTS:

l_actvt TYPE tact-actvt VALUE '10'.

AUTHORITY-CHECK OBJECT 'zauth_obj' " this is ur authorization object.

ID 'ACTVT' FIELD l_actvt.

IF sy-subrc > 0.

MESSAGE 'You do not have authorization to POST the document.' TYPE 'E'.

ENDIF.

ENDFORM. " chk_auth

reward points if you find this helpful.

regards,

Aabhas K Vishnoi

Former Member
0 Kudos

Checking User Authorizations in your ABAP Program

How to set Authorization to an ABAP Programs?

Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.

If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.

This means you have to allocate an authorization object in the definition of the transaction.

For example:

program an AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT <authorization object>

ID <authority field 1> FIELD <field value 1>.

ID <authority field 2> FIELD <field value 2>.

...

ID <authority-field n> FIELD <field value n>.

The OBJECT parameter specifies the authorization object.

The ID parameter specifies an authorization field (in the authorization object).

The FIELD parameter specifies a value for the authorization field.

The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.

0 Kudos

can u tell me how to create an authorization object

Former Member
0 Kudos

Hi,

Please check the link that I have mentioned in my previous reply..

Thanks,

Naren