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

Data Locking

Former Member
0 Likes
787

Dear all,

I have a Z program that performing ZTABLE delete and update. The execution of the program is being scheduled every night, and multiple jobs need to be created for the same program due to different job need to update/delete different company code data into ZTABLE. Like below:

Job 1, Company code = A100, A200, A300, A400

Job 2, Company code = B100, B200, B300, B400

Job 3, Company code = C100, C200, C300, C400

Since jobs are execute at the same timing, so i need to implement locking on ZTABLE.

Im thinking to lock ZTABLE at record level. Means During Job1's execution, i will lock data for company code A100, A200, A300 and A400. Once lock obtained, then program will proceed to delete company A* data and then follow by update company A* back to ZTABLE with latest data.

On the other side, same program for Job 2 is executing at the same time. This time program is locking data for company B100, B200, B300 and B400. And then program will delete and update ZTABLE dealing with company B* data only.

I might need your advice with the above design if it is workable. Please comment.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
746

Why don't you create lock object for you ZTABLE via SE11 ?

Then use function ENQUEUE_ZTABLE (with exclusive lock option) to lock and DEQUEUE_ZTABLE to unlock.

Thanks and regards,

Thanagit

5 REPLIES 5
Read only

Former Member
0 Likes
747

Why don't you create lock object for you ZTABLE via SE11 ?

Then use function ENQUEUE_ZTABLE (with exclusive lock option) to lock and DEQUEUE_ZTABLE to unlock.

Thanks and regards,

Thanagit

Read only

0 Likes
746

Yes, im using the ENQUEUE FM to achieve my locking purpose.

I need advice if my design is acceptable.

Read only

0 Likes
746

Hi,

Yes it would work, and its a good approach too which will save lots of time

Regards,

Siddarth

Read only

0 Likes
746

Yes. Your approach holds good.

Use Commit statement to update the records and Enqueue/Dequeue statements to lock and unlock.

For more information use F1 or search SDN forums.

Hope this is helpful

Thanks,

Babu Kilari

Read only

Former Member
0 Likes
746

No explanation why 'Yes'.

How come you believe ?

good luck