Application Development 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: 

lock table problem

Former Member
0 Kudos

Hi,

I created a lock object so that I can lock a table at row level. After running the program(a T-Code), the related row(based on the fields) locked by calling function ENQUEUE_EZABC. If another user run this program at same time, the user can not access the row which I locked. Works fine.

Here is the ENQUEUE_EZABC

CALL FUNCTION 'ENQUEUE_EZABC'

EXPORTING

mode_ztable = 'X'

field1 = itab-field1

field2 = itab-field2

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

But, if the user runs SM30(or other program which uses this table) to maintian this table, the user still can access all rows and can edit(delete or insert) them. That means there is no lock at all.

Why? By the way, the lock mode is E.

Thanks

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

SM30 uses its own locking machnism. if you have marked , you can LOCK the entire table only, you can not lock at the record level.

For your other zprograms you need to apply the locking mechnism by calling the FM 'ENQUEUE_EZABC' and DEQUEUE_EZABC in each and every program.

Regards,

Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

SM30 uses its own locking machnism. if you have marked , you can LOCK the entire table only, you can not lock at the record level.

For your other zprograms you need to apply the locking mechnism by calling the FM 'ENQUEUE_EZABC' and DEQUEUE_EZABC in each and every program.

Regards,

Naimesh Patel

Former Member
0 Kudos

Yes - SAP locking is logical not physical (at the database level). SM30 doesn't know anything about your lock object unless you add it to the table maintenance generator.

Rob