08-18-2007 8:52 PM
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'.
08-19-2007 1:44 AM
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
08-18-2007 9:47 PM
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>.
08-18-2007 10:05 PM
Yes, this one: AUTHORITY_CHECK_TCODE
Regards.
Please reward points if helpful.
08-18-2007 11:23 PM
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
08-19-2007 1:44 AM
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