Skip to Content
author's profile photo Former Member
Former Member

Custom ABAP code to unlock users who are locked due to incorrect login attempts

Hello,

I need a custom ABAP code to unlock users who are locked due to incorrect login attempts. I plan to schedule it as a background job hourly for Saturday and Sunday nights where no support or basis personnel available.

Thank you,

Chathuranga.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2013 at 08:36 AM

    You can use FMs BAPI_USER_GETLIST to read users from system, BAPI_USER_GET_DETAIL for check is user locked, BAPI_USER_LOCK/BAPI_USER_UNLOCK for lock/unlock users.

    Regards,
    Roman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 21, 2013 at 06:23 AM

    Hi Chathuranga,

    Check table USR02 with an input to field User Lock (UFLAG)=128 (purely incorrect password lock), that will help you identify users locked due to incorrect login attempts.

    You may write a simple abap report to query this table and identify users with uflag status 128. Next piece of code should be to update this uflag =0 for the identified list of users.

    You may schedule this report after testing in background.

    Regards,

    Deepak Kori

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 08, 2013 at 07:15 AM

    This is what I did

    Logic for the Report

    1. Read the user list from system with BAPI_USER_GETLIST

    1. Use BAPI_USER_GET_DETAIL to check the user status for locked due to failed login attempts. This will be indicated in Export parameter ISLOCKED with value LUUU

    List the locked users with failed login attempts

    1. Then unlock the selected users from BAPI_USER_UNLOCK
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.