Please find the procedure below.
Tools --> Administration --> User Maintenance --> user (i.e. SU01) Step 1: Select Menu Environment --> Mass Changes. Step 2: Click "Address Data" button Step 3: F8 (execute) to select users to be locked. Step 4: Select users to be locked and click "Transfer" Button. Step 5: Click Lock / Unlock icon to lock or unlock the selected users.
courtsey : https://searchsap.techtarget.com/tip/Mass-user-Locking-and-Unlocking-SAP-R-3-46#:~:text=Please%20find%20the%20procedure%20below,and%20click%20%22Transfer%22%20Button.