Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lock Object (Not locking the table)

Former Member
0 Likes
493

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.

4 REPLIES 4
Read only

kanthimathikris
Advisor
Advisor
0 Likes
434

I can see a value "0" for the field OBZAE; is that the reason

Read only

0 Likes
434

Hi Kanthimathi

That is numeric field . Please suggest me how can i check the lock.

Read only

kanthimathikris
Advisor
Advisor
0 Likes
434

chk in transaction SM12

Read only

Former Member
0 Likes
434

Thanku very much for support . Closing the thread.