Friday, November 5, 2010

It is normal when we hit password wrong and our login gets lock,
this small piece of code unlocks the user when he/she hits wrong password.

*&---------------------------------------------------------------------*
*& program unlock password flag
*&---------------------------------------------------------------------*
REPORT YKC_PWORD.

tables: usr02.

selection-screen begin of block blck1.*---name of userparameters: p_user like usr02-bname .
selection-screen end of block blck1.

at selection-screen.
select single bname
into usr02-bname
from usr02 where bname = p_user.

if sy-subrc ne 0.
message 'User Not Exist' type 'E'.
endif.

update usr02 set uflag = 0
where bname = p_user.

if sy-subrc = 0.
message ' User Succesfully unlocked' type 'E'.
else.
message 'User failed to unlock' type 'E'.
endif.

0 comments: