ABAP Program to Break the Editor Lock

0
538

Some of you must had came across this simple problem when you want to modify a program that ‘ The program locked by previous programmer ‘ . So what we should do? We need to unlock the program. Here a simple program to lock/unlock a program.

First, let find where flag for luck/unlock program is store.

  • Open program using Abap Editor(SE38).
  • Select menu: Goto > Attributes
  • Select Editor Lock and then press F1, it will display Performance Assitant
  • Click icon Technical Information

Here we find what we need.
Table Name : TRDIR
Field Name : EDTX

Now we can create simple program for lock/unlock program.
Here the the code:

REPORT  Z_JRQ021R.

TABLES: TRDIR. “System table

PARAMETERS: P_NAME LIKE TRDIR-NAME,

P_LOCK  LIKE TRDIR-EDTX.

SELECT SINGLE * FROM TRDIR WHERE NAME = P_NAME.

TRDIR-EDTX  = P_LOCK.

TRDIR-UNAM  = TRDIR-CNAM.

TRDIR-UDAT  = TRDIR-CDAT.

TRDIR-SDATE = TRDIR-CDAT.

TRDIR-IDATE = TRDIR-CDAT.

MODIFY TRDIR.

IF SY-SUBRC EQ 0.

IF TRDIR-EDTX = ‘X’.

WRITE: ‘ Lock Program:’, TRDIR-NAME.

ELSE.

WRITE: ‘ UnLock Program:’, TRDIR-NAME.

ENDIF.

ELSE.

WRITE: / ‘Lock/Unlock program failed ‘, TRDIR-NAME.

ENDIF.

Note:

  • P_NAME = Program Name
  • P_LOCK = Lock / Unlock Program

LEAVE A REPLY

Please enter your comment!
Please enter your name here