Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

ABAP Program to Unlock Login ID in SAP

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

*&---------------------------------------------------------------------* *& Report ZVAI_HR_UNLOCKUSER *& *&---------------------------------------------------------------------* * AUTHOR : Vaibhav Sambare * * * DESCRIPTION : ABAP Program to Unlock Login ID in SAP * *&---------------------------------------------------------------------* REPORT zvai_hr_unlockuser. 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 successfully unlocked' TYPE 'I'. ELSE. MESSAGE 'user failed to unlock' TYPE 'E'. ENDIF.

Execute

You might also like