Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SUSR_BAPI_USER_UNLOCK LOCK_WRONG_LOGON question

Former Member
0 Likes
784

When a user is locked because of too many wrong logons, it seems the correct way to unlock the user is to use SUSR_BAPI_USER_UNLOCK.

When I do this through my native SAP GUI, I need to set LOCK_WRONG_LOGON = 'X'. This works fine. I am trying to do it remotely though. I have the command remote enabled but when I send it, it is not working. I do not see any error messages in my trace. Below is the XML version of the command I am sending to the system. It seems correct to me. Can anyone see any problems?

<SUSR_BAPI_USER_UNLOCK>

<INPUT><LOCK_GLOBAL><BAPIFLAG></BAPIFLAG></LOCK_GLOBAL><LOCK_LOCAL><BAPIFLAG></BAPIFLAG></LOCK_LOCAL><LOCK_WRONG_LOGON><BAPIFLAG>X</BAPIFLAG></LOCK_WRONG_LOGON><USERNAME>ES2N</USERNAME></INPUT>

<TABLES><RETURN></RETURN></TABLES>

</SUSR_BAPI_USER_UNLOCK>

The response I get is below. It seems to say that the user was unlocked if it is allowed on the system. It is allowed, because it works natively.

<SUSR_BAPI_USER_UNLOCK>

<INPUT><LOCK_GLOBAL><BAPIFLAG></BAPIFLAG></LOCK_GLOBAL><LOCK_LOCAL><BAPIFLAG></BAPIFLAG></LOCK_LOCAL><LOCK_WRONG_LOGON><BAPIFLAG>X</BAPIFLAG></LOCK_WRONG_LOGON><USERNAME>ES2N</USERNAME></INPUT>

<TABLES><RETURN><item><TYPE>S</TYPE><ID>01</ID><NUMBER>246</NUMBER><MESSAGE>User ES2N unlocked, if this is permitted in this system</MESSAGE><LOG_NO></LOG_NO><LOG_MSG_NO>000000</LOG_MSG_NO><MESSAGE_V1>ES2N</MESSAGE_V1><MESSAGE_V2></MESSAGE_V2><MESSAGE_V3></MESSAGE_V3><MESSAGE_V4></MESSAGE_V4><PARAMETER></PARAMETER><ROW>0</ROW><FIELD></FIELD><SYSTEM>SAP1</SYSTEM></item></RETURN></TABLES>

</SUSR_BAPI_USER_UNLOCK>

Any thoughts would be greatly appreciated.

3 REPLIES 3
Read only

Former Member
0 Likes
635

It looks to me as if the user is being unlocked correctly.

Rob

Read only

0 Likes
635

Found my problem. The call actually works correctly. The user name had been changed by other code that I wasnt aware of. Thank you guys for taking a look.

Read only

Former Member
0 Likes
635

Try the same with BAPI_USER_UNLOCK?

PS: Also take note that SUSR_BAPI_USER_UNLOCK is not remote enabled itself. So it might be that ES2N unlocked in the calling client / system, and not in the target.

Edited by: Julius Bussche on Jul 14, 2008 6:34 PM