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: 

Transaction Codes

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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>.

alejandro_bindi
Active Contributor
0 Kudos

Yes, this one: AUTHORITY_CHECK_TCODE

Regards.

Please reward points if helpful.

Former Member
0 Kudos

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

Former Member
0 Kudos

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