2010 Nov 24 11:46 AM
Hi Folks,
I was trying to use the Function Module SUSR_INTERNET_USERSWITCH to perfrom a user switch. I have two users, one which is of type service and the other of type dialog. When I test the function module in se37 or by writing a report, I get an exception like
more than one external mode => switch not possible
RAISE MORE_THAN_ONE_MODE
This exception is due to the call at line # 233 in the FM.
actuall 'delayed logon' (switch from 'anonymous' to 'named'):
CALL 'INTERNET_USER_LOGON' ID 'UNAME' FIELD USERID
ID 'PASSW' FIELD PASSWORD
ID 'TICKET' FIELD TICKET
ID 'PASSFLAG' FIELD PWDSTATE.
Is there any way I can get around this issue?
Regards,
Gaurav
Hi Folks,
I was trying to use the Function Module SUSR_INTERNET_USERSWITCH to perfrom a user switch. I have two users, one which is of type service and the other of type dialog. When I test the function module in se37 or by writing a report, I get an exception like
more than one external mode => switch not possible
RAISE MORE_THAN_ONE_MODE
This exception is due to the call at line # 233 in the FM.
actuall 'delayed logon' (switch from 'anonymous' to 'named'):
CALL 'INTERNET_USER_LOGON' ID 'UNAME' FIELD USERID
ID 'PASSW' FIELD PASSWORD
ID 'TICKET' FIELD TICKET
ID 'PASSFLAG' FIELD PWDSTATE.
Is there any way I can get around this issue?
Regards,
Gaurav
2010 Nov 24 12:05 PM
Try this one
CALL FUNCTION 'SUSR_INTERNET_USERSWITCH' "
EXPORTING
alias = " bapialias Internet User Alias
username = " bapibname-bapibname User Name
password = " bapipwd SAP user password
IMPORTING
bname_after_switch = " ususername
pwdstate = " xupwdstate Status of the User Password
TABLES
return = " bapiret2 Return parameter
EXCEPTIONS
CURRENT_USER_NOT_SERVICETYP = 1 "
MORE_THAN_ONE_MODE = 2 "
INTERNAL_ERROR = 3 " Internal Error
.
2010 Nov 24 12:07 PM
2010 Nov 24 12:25 PM
lv_user_before = sy-uname.
CALL FUNCTION 'SUSR_INTERNET_USERSWITCH'
EXPORTING
alias = lv_alias
password = lv_password
IMPORTING
BNAME_AFTER_SWITCH =
PWDSTATE =
PWD_CHANGE_SSO =
TABLES
return = lt_return
EXCEPTIONS
current_user_not_servicetyp = 3
more_than_one_mode = 2
internal_error = 1
OTHERS = 4
.
IF sy-subrc > 1
OR ( sy-subrc = 1 AND sy-uname = lv_user_before ).
Error during User Switch
ELSE.
everything OK
ENDIF.
2010 Nov 24 12:38 PM
I think I did not put my question across v clearly. Its not that I do not know how to handle the exception. Its just that I want to know why the exception is happening and get rid of it so that the user switch happens succesfully.
Regards,
Gaurav
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |