2013 Dec 19 10:29 AM
Hello techies,
i need to check the lock status of the user .
i know table usr02-bname.
But that is not geting the right status.
Can you help me to get status using any bapi or fm.
Thanks..
2013 Dec 19 4:47 PM
Hi Praveen,
Use the BAPI BAPI_USER_GET_DETAIL to get the user details and you can use BAPI_USER_LOCK and BAPI_USER_UNLOCK to lock and unlock users respectively.
Obviously, you need to have authorizations to do so.
Do let me know if it helped.
Thanks,
Anupam
2013 Dec 19 10:37 AM
2013 Dec 20 1:23 AM
hi kiran .
it will also get the lock details but only system admin lock and global.
no option if too many password attempts.
anyways it also helped me.
thanks.
2013 Dec 19 10:43 AM
2013 Dec 19 11:35 AM
2013 Dec 19 11:38 AM
Have you tried the mentioned FM, what exactly you are looking for!
2013 Dec 19 12:29 PM
then check with reply with below code ...
IF LOCKSTATE-LOCAL_LOCK = 'U' AND LOCKSTATE-GLOB_LOCK = 'U'.
Write :/1 'User not locked'.
ELSEIF LOCKSTATE-LOCAL_LOCK = 'L' AND LOCKSTATE-GLOB_LOCK = 'U'.
Write :/1 'User locked locally and unlocked globally'.
ELSEIF LOCKSTATE-LOCAL_LOCK = 'U' AND LOCKSTATE-GLOB_LOCK = 'L'.
Write :/1'User unlocked locally and locked globally'.
ELSEIF LOCKSTATE-LOCAL_LOCK = 'L' AND LOCKSTATE-GLOB_LOCK = 'L'.
Write :/1'User locked locally and locked globally'.
ELSE.
Write :/1'No user lock status available'.
ENDIF.
Regard's
Smruti
2013 Dec 20 9:00 AM
I hope you got your required solution , but can try with below code once .. .
DATA : S_BNAME TYPE XUBNAME ,
S_UFLAG TYPE XUUFLAG ,
S_MODDA TYPE XUMODDATE ,
S_MODTI TYPE XUMODTIME .
SELECT SINGLE A~BNAME A~UFLAG A~MODDA A~MODTI INTO (S_BNAME,S_UFLAG,S_MODDA,S_MODTI)
FROM USH02 AS A WHERE A~BNAME = 'SMRUTI'
AND A~MODDA = ( SELECT MAX( B~MODDA ) FROM USH02 AS B
WHERE B~BNAME = 'SMRUTI')
AND A~MODTI = ( SELECT MAX( C~MODTI ) FROM USH02 AS C
WHERE C~BNAME = 'SMRUTI' AND C~MODDA = A~MODDA ).
WRITE: /1 'User Name :' ,S_BNAME,
'User Status : ' ,S_UFLAG .
Regard's
Smruti
2013 Dec 19 4:47 PM
Hi Praveen,
Use the BAPI BAPI_USER_GET_DETAIL to get the user details and you can use BAPI_USER_LOCK and BAPI_USER_UNLOCK to lock and unlock users respectively.
Obviously, you need to have authorizations to do so.
Do let me know if it helped.
Thanks,
Anupam
2013 Dec 20 1:20 AM
cheers anupam..
i got with your bapi..
exporting parameter isylock did the thing.
thanks..
2013 Dec 20 7:56 AM