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

Transaction Codes

Former Member
0 Likes
750

Is there a function that I can invoke from within my ABAP

program to determine if the logged in user has permission

to execute a transaction?

For example,

call 'functionA'

exporting tcode = 'ME51N'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
725

Simplest way is the AUTHORITY-CHECK ABAP staatement.

For transaction code ME51N:

AUTHORITY-CHECK OBJECT 'S_TCODE'
         ID 'TCD' FIELD 'ME51N'.

In SE38 the "Pattern" button includes this statement - you just need to know the Auth Object and it will paste in the correct code.

Andrew

4 REPLIES 4
Read only

Former Member
0 Likes
725

Hi,

Try these...

1)Try calling the transaction and catching the exception if there is no authorization.

2)There is a function module to find the program name and screen for a transaction and vice-versa... <i><b>RPY_TRANSACTION_READ</b></i>

using authorization check find if user has permission to run the same.

3) Try these fm...

<i><b>SXPG_CALL_SYSTEM</b></i> "This is only for external programs... try if it works!

<i><b>GET_AUTH_VALUES</b></i>

Regards,

<i><b>Naveenan</b></i>.

Read only

alejandro_bindi
Active Contributor
0 Likes
725

Yes, this one: AUTHORITY_CHECK_TCODE

Regards.

Please reward points if helpful.

Read only

Former Member
0 Likes
725

Hi,

AUTHORITY – CHECK OBJECT <object name>

ID <name1> FIELD <f1>

ID <name2> FIELD <f2>

IF SY-SUBRC NE 0.

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

Regards,

Murali

Read only

Former Member
0 Likes
726

Simplest way is the AUTHORITY-CHECK ABAP staatement.

For transaction code ME51N:

AUTHORITY-CHECK OBJECT 'S_TCODE'
         ID 'TCD' FIELD 'ME51N'.

In SE38 the "Pattern" button includes this statement - you just need to know the Auth Object and it will paste in the correct code.

Andrew