2010 Dec 30 6:27 AM
hello friends,
I am using FM 'SUSR_USER_AUTH_FOR_OBJ_GET'. I want to display error message if user is not authorised.
For this I am entering value on selection screen and calling this FM.
call function 'SUSR_USER_AUTH_FOR_OBJ_GET'
exporting
user_name = 'TESTUSER'
SEL_OBJECT = 'S_TCODE'
tables
values = values
exceptions
user_not_exist = 1
not_authorized = 2
internal_error = 3
others = 4.
My problem is how will I display error message and which fields of table 'VALUES' shoulld I compare with selection screen field.
2010 Dec 30 6:48 AM
Hi,
Please refer the documentation available in the system for that FM.
It clearly states all the possible exception which you can throw, how to compare the field values etc.
USER_NAME_NOT_EXIST
NOT_AUTHORIZED
INTERNAL_ERROR
regards,
Mullai
hello friends,
I am using FM 'SUSR_USER_AUTH_FOR_OBJ_GET'. I want to display error message if user is not authorised.
For this I am entering value on selection screen and calling this FM.
call function 'SUSR_USER_AUTH_FOR_OBJ_GET'
exporting
user_name = 'TESTUSER'
SEL_OBJECT = 'S_TCODE'
tables
values = values
exceptions
user_not_exist = 1
not_authorized = 2
internal_error = 3
others = 4.
My problem is how will I display error message and which fields of table 'VALUES' shoulld I compare with selection screen field.
2010 Dec 30 6:41 AM
Hi,
I think what you are trying to do is enter transaction code on the selection and check if the user 'TESTUSER' has authorizations for it. The field that would have all the transactions that the user would have is 'VON' in the structure VALUES.
FM also has some documentation that you can refer to.
So you need to check if the value on the selections is there and fire the error if not.
Regards,
Himanshu
2010 Dec 30 6:45 AM
DATA: user_nm LIKE usr02-bname,
sel_object LIKE ust12-objct VALUE 'K_CSKS'.
DATA: values LIKE STANDARD TABLE OF usvalues.
user_nm = sy-uname.
CALL FUNCTION 'SUSR_USER_AUTH_FOR_OBJ_GET'
EXPORTING
user_name = user_nm
sel_object = sel_object
TABLES
values = values
EXCEPTIONS
user_name_not_exist = 1
not_authorized = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIFCheck VON in USVALUES.
Edited by: K.Manas on Dec 30, 2010 7:45 AM
2010 Dec 30 6:48 AM
Hi,
Please refer the documentation available in the system for that FM.
It clearly states all the possible exception which you can throw, how to compare the field values etc.
USER_NAME_NOT_EXIST
NOT_AUTHORIZED
INTERNAL_ERROR
regards,
Mullai
2010 Dec 30 7:10 AM
Thank you for replying friends..Points are given.
I would also like to know what values can VON have??
Like if VON is having value ' * ' then user is having all authorisations..right???
what other values can VON have?
2010 Dec 30 7:19 AM
Hi,
VON will have values for the fields in the authorization object that you are checking like when you have authorization object S_TCODE only has one field TCD it shows the value for that if it had other fields also they we would have got values for other objects also .The field name is in the Field 'Field'.
Yes '*' means auth to all.
Regards,
Himanshu
2010 Dec 30 9:05 AM
But my question is what other values VON can have besides ' * ' .
2010 Dec 30 10:03 AM
Other transactions codes like SE38,SE71 etc. when you use object S_TCODE.
Himanshu
2011 Jan 05 11:24 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |