ABAP Program to Unlock Login ID in SAP

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

*&———————————————————————*
*& program unlock password flag
*&———————————————————————*

REPORT YKC_PWORD.

tables: usr02.

selection-screen begin of block blck1.
*—name of user
parameters: 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.

You might also be interested in these posts:

  1. Deactivate an Account in SAP
  2. ABAP Program to Break the Editor Lock
  3. ABAP Program for Table Maintenance in SAP
  4. ABAP Program to Track ‘Hard Coding’ in Programs
  5. ABAP Program to Search For SMARTFORMS in your Language

No Responses to “ABAP Program to Unlock Login ID in SAP”

Post a Comment