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.
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:
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.
IF SY-SUBRC EQ 0.
IF TRDIR-EDTX = ‘X’.
WRITE: ‘ Lock Program:’, TRDIR-NAME.
WRITE: ‘ UnLock Program:’, TRDIR-NAME.
WRITE: / ‘Lock/Unlock program failed ‘, TRDIR-NAME.