‎2007 Jun 19 8:01 AM
HI,
PLease suggest me any function module whihc will check the user's authorization against a T_code (Ex: VA02).
It will be appriciated if, usage direction are suggested.
Thanks,
Jaleel.
‎2007 Jun 19 8:10 AM
<b>You can do it without Function using AUTHORITY-CHECK</b>Syntax
AUTHORITY-CHECK OBJECT <object> ID <name1> FIELD <f1>
ID <name2> FIELD <f2>
...
ID <name10> FIELD <f10>.
There is a check if the program user has all the authorizations defined in authorization object <object>. <name1>,..., <name10> are the authorization fields of the authorization object. <f1>,... <f1>, ..., <f10> are data objects of the program. The value of the data objects is checked against the authorization fields.
FM: AUTHORITY_CHECK_RFC for Authorization check
If the RFC communication takes place in one system in the same user context - that is, using the same client and user ID - the system does not carry out an RFC authority check. For more information on this topic, see
SXPG_COMMAND_EXECUTE: Check Authorization for and Execute an External Command
Regards,
Vishal
‎2007 Jun 19 8:03 AM
hi..
Just execute transaction VA02 for user. Afterwards call transaction SU53 and you will get an overview of all missing authorizations.
thanks
Ashu
‎2007 Jun 19 8:08 AM
HI Ashu,
Thanks for the responce. I need to check this programatically.
Check if user is auth to execute VA02.
If yes. call Transaction VA02.
Else. Call transaction VA03.
HOpe this gives u clear idea.
Please suggest.
‎2007 Jun 19 8:11 AM
hi..
this u can write by using the if condition na...using sy-subrc first check and then u can use the if condition..am not that much clear. anyway u please try..
Thanks
Ashu
‎2007 Jun 19 8:13 AM
‎2007 Jun 19 8:10 AM
<b>You can do it without Function using AUTHORITY-CHECK</b>Syntax
AUTHORITY-CHECK OBJECT <object> ID <name1> FIELD <f1>
ID <name2> FIELD <f2>
...
ID <name10> FIELD <f10>.
There is a check if the program user has all the authorizations defined in authorization object <object>. <name1>,..., <name10> are the authorization fields of the authorization object. <f1>,... <f1>, ..., <f10> are data objects of the program. The value of the data objects is checked against the authorization fields.
FM: AUTHORITY_CHECK_RFC for Authorization check
If the RFC communication takes place in one system in the same user context - that is, using the same client and user ID - the system does not carry out an RFC authority check. For more information on this topic, see
SXPG_COMMAND_EXECUTE: Check Authorization for and Execute an External Command
Regards,
Vishal
‎2007 Jun 19 8:12 AM
Hi,
You can use function module AUTHORITY_CHECK_TCODE for this. Some thing like,
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
TCODE = <Your Tcode here>
EXCEPTIONS
OK = 0
NOT_OK = 1
OTHERS = 2.
IF sy-subrc <> 0.
****No Authorization
ENDIF.
Hope this helps..
Regards