‎2010 Feb 24 2:35 PM
Hi gurus,
anybody has experience of checking authorizations via RFC method? Is there any RFC enabled function module in standard system can do that?
Thanks & regards,
Alex
‎2010 Feb 25 10:12 AM
Hi,
Try this FM AUTHORITY_CHECK.
You can call in Remote and you can pass User ID.
You must pass also Authority check you would like test.
Example
CALL FUNCTION 'AUTHORITY_CHECK'
EXPORTING
* NEW_BUFFERING = 3
USER = 'SAP*' "SY-UNAME
OBJECT = S_TCODE " Objet name This check transaction code
FIELD1 = 'TCODE' " Field name of Object
VALUE1 = 'VA02' " Transaction to modify sales Order
* FIELD2 = ' '
* VALUE2 = ' '
* FIELD3 = ' '
* VALUE3 = ' '
* FIELD4 = ' '
* VALUE4 = ' '
* FIELD5 = ' '
* VALUE5 = ' '
* FIELD6 = ' '
* VALUE6 = ' '
* FIELD7 = ' '
* VALUE7 = ' '
* FIELD8 = ' '
* VALUE8 = ' '
* FIELD9 = ' '
* VALUE9 = ' '
* FIELD10 = ' '
* VALUE10 = ' '
EXCEPTIONS
USER_DONT_EXIST = 1
USER_IS_AUTHORIZED = 2
USER_NOT_AUTHORIZED = 3
USER_IS_LOCKED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Rgds
‎2010 Feb 24 3:24 PM
Hi,
something more specific please; otherwise the answer is very general.
Probably you´ll have to create your own RFC-enabled function for reading the authorizations for object & user in the target system. Your return parameter could be a 'X' if sucessful or ' ' if no authorization.
‎2010 Feb 25 3:22 AM
Hi all,
thanks for your reply.
I need to check user authorizations in a java application connecting to R/3 via RFC. Currently the user profile name can be read via BAPI_USER_GET_DETAIL. I need to know whether the user has authorization to do something in Java application. If in ABAP, we have key word AUTHORITY-CHECK OBJECT to do the job. I need RFC method with similar functionalitiy, so I can call it from Java application.
I hope SAP has standard RFC doing that. If not, maybe I need create my own.
Thanks.
‎2010 Feb 24 3:34 PM
Hi!
Let's see it through an example, like there are 2 SAP systems, A and B.
You made an RFC ready FM in system A.
You wanted to call this RFC ready FM, from system B.
For this you have to set up and RFC connection first in system B, using SM59 transaction. This RFC connection requires a SAP user in system B for logging into the system. In most common there are system type users in system B, and these system users have SAP_ALL authority to be able to run everything. Note: systems users cannot be used manually, only for running jobs, using RFC etc...
Regards
Tamá
‎2010 Feb 25 6:49 AM
‎2010 Feb 25 7:32 AM
Hi Choudhary,
thanks. but that's not the one. it checks whether an user has permission to execute a RFC FM. I need a RFC FM checking user against any authorization objects.
Thanks .
‎2010 Feb 25 10:12 AM
Hi,
Try this FM AUTHORITY_CHECK.
You can call in Remote and you can pass User ID.
You must pass also Authority check you would like test.
Example
CALL FUNCTION 'AUTHORITY_CHECK'
EXPORTING
* NEW_BUFFERING = 3
USER = 'SAP*' "SY-UNAME
OBJECT = S_TCODE " Objet name This check transaction code
FIELD1 = 'TCODE' " Field name of Object
VALUE1 = 'VA02' " Transaction to modify sales Order
* FIELD2 = ' '
* VALUE2 = ' '
* FIELD3 = ' '
* VALUE3 = ' '
* FIELD4 = ' '
* VALUE4 = ' '
* FIELD5 = ' '
* VALUE5 = ' '
* FIELD6 = ' '
* VALUE6 = ' '
* FIELD7 = ' '
* VALUE7 = ' '
* FIELD8 = ' '
* VALUE8 = ' '
* FIELD9 = ' '
* VALUE9 = ' '
* FIELD10 = ' '
* VALUE10 = ' '
EXCEPTIONS
USER_DONT_EXIST = 1
USER_IS_AUTHORIZED = 2
USER_NOT_AUTHORIZED = 3
USER_IS_LOCKED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Rgds
‎2010 Feb 25 12:02 PM