How to delete an editor lock?

A user created an ABAP program and enabled the "Editor Lock" option in the Program Attributes screen. This setting restricts modifications to the program, allowing only the original user to make changes.

The same user left the project a year ago, and now there is a need to update the program. However, when anyone else attempts to modify it, the system displays the following message: "The program is locked from any changes. Only the original user can change it."

Issue: The "Editor Lock" setting is stored in the TRDIR table, but this table cannot be manually edited.

Solution: The editor lock in an ABAP program is defined in the TRDIR table, under the field EDTX. To unlock the program, you must change the value of the field from 'X' (locked) to ' ' (unlocked).

Here is an example program to unlock the editor lock for your program:

REPORT sy-repid. 
TABLES: TRDIR. 

PARAMETERS: P_PROG LIKE TRDIR-NAME OBLIGATORY. 

START-OF-SELECTION. 
  SELECT SINGLE * FROM TRDIR WHERE NAME = P_PROG. 
  IF SY-SUBRC = 0. 
    IF TRDIR-EDTX = 'X'. 
      MOVE ' ' TO TRDIR-EDTX. 
      MODIFY TRDIR. 
      WRITE: /'Editor Lock was removed from', P_PROG. 
    ELSE. 
      WRITE: /'Program', P_PROG, 'does not have an Editor Lock'. 
    ENDIF. 
  ELSE. 
    WRITE: /'No match found for program', P_PROG. 
  ENDIF.

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

ABAP Functions Tips
ABAP Functions Examples

ABAP Tips
ABAP Forum for Discussion and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.