‎2007 Sep 10 6:40 AM
Hi Guys
I have a custom table ZDRAD same like standard table DRAD with an additional 'DATE' field . ZDRAD's Key fields are same like DRAD . I have created a lock object 'EZDRAD' where I put name = 'ZDRAD' (Custom table) and mode = 'EXCLUSIVE CUMULATIVE' . Now I want to lock the table(Whole table) before modifying/Inserting/deleting the records in se38. Please check the code below and suggest me if I am passing wrong values to the lock object Function module.
Code
**********************************
TABLES : ZDRAD.
CALL FUNCTION 'ENQUEUE_EZDRAD'
EXPORTING
MODE_ZDRAD = 'E'
MANDT = SY-MANDT
DOKAR = ' '
DOKNR = ' '
DOKVR = ' '
DOKTL = ' '
DOKOB = ' '
OBZAE = 0
OBJKY = ' '
X_DOKAR = ' '
X_DOKNR = ' '
X_DOKVR = ' '
X_DOKTL = ' '
X_DOKOB = ' '
X_OBZAE = ' '
X_OBJKY = ' '
_SCOPE = '2'
_WAIT = 'X'
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
IF SY-SUBRC = 0.
ZDRAD table is locked.
P_L_LOCK_STAT = 'X'.
EXIT.
ELSE.
ZDRAD table is not locked
CLEAR P_L_LOCK_STAT .
ENDIF.
‎2007 Sep 10 9:46 AM
‎2007 Sep 10 10:45 AM
Hi Kanthimathi
That is numeric field . Please suggest me how can i check the lock.
‎2007 Sep 10 11:06 AM
‎2011 Mar 11 5:21 AM