cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization object for executing Custom WD application

Former Member
0 Kudos

Dear Experts,

Can anyone let me know "how to create Authorization object for executing Custom WD application "?.

If particular user is not authorited for executing my Z-WD Appl, then i need to show error " You are not authorized to execute" and need stop him to proceed further.

Thanks

Katrice

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Katrice,

You can use SU21 to create a new authorization object or find an existing one that meets your needs. Often a business analyst will have an idea of what authorization role/object will be assigned to users so you can check with your analyst if your organization is set up that way. If you are creating the authorization object yourself, here is a document that may be helpful, .

Once you have an authorization object in mind, you can call the standard authority-check, for example...

authority-check object 'MY_AUTH_OBJECT'
                           id 'ACTVT'

                           field '45'.

Authorization field "ACTVT" means "activity" and activity 45 is "allow" but you can use any ID and field you like when setting up the authorization object. If the user fails the authority-check, sy-subrc will be non-zero and you can issue a message to the user or redirect them to a different view that has information on who to contact for assistance. I usually include a "not authorized" view in my applications and redirect the user there.

Function module AUTHORITY_CHECK mimics the call to authority-check if you prefer a function call to check the user's authorization.

Cheers,

Amy

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you very much Amy.Issue resolved.

Thanks

Katrice

shuai_liang
Participant
0 Kudos

Hi Katrice,

You can create your own object class and authorization object in transaction SU21.

And you can use the autorization object in your WD application.

Best regards,

Shuai Liang

Former Member
0 Kudos

Thank you very much Shuai.

Thanks

Katrice

Former Member
0 Kudos
Former Member
0 Kudos

Thank you very much Abhirami.

Thanks

Katrice