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: 

Concurrent updation of z table

Former Member
0 Kudos

Dear Experts,

If a z-transparent table is being updated by a batch program , and sometime during this process, another batch job calling the same program but with different selections needs to update the same table, what happens?

Will there be some data not updated by either programs if the keys are different?

How does SAP handle this?

Also, what then if there is overlapping selections?

Both jobs ran and completed successfully but I am not sure the data if properly updated as there are too many entries.

regards

Bass

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Are you using SAP locking concept for table before updating the table?

If not then database lock will handle the situation and if parallel screens will try to update records of same key then one of the program may not be able to update the entry, otherwise entries will be updated if updation will happen for different keys.

Hope above explination is sufficient and if you need more explination on lock objects and table locks then you can search for many more threads or else let me know if I can help you.

Regards,

Umang Mehta

5 REPLIES 5

Former Member
0 Kudos

Hi,

Are you using SAP locking concept for table before updating the table?

If not then database lock will handle the situation and if parallel screens will try to update records of same key then one of the program may not be able to update the entry, otherwise entries will be updated if updation will happen for different keys.

Hope above explination is sufficient and if you need more explination on lock objects and table locks then you can search for many more threads or else let me know if I can help you.

Regards,

Umang Mehta

Former Member
0 Kudos

Hi,

IF you are updating a table, its beeter if you lock the data before updating it.Just to avoid any discrepancies during update.

Especially when more then one tasks acess the same data.

Former Member
0 Kudos

Before and after the updation statement use enque & deque FM

Thanks,

Giridhar

Former Member
0 Kudos

Hi,

We can lock the table before updating the entries. Two types of locks are there.

1. To lock the entire table. Here when the table is locked by one program, another program will not be able to modify it.

2. To lock the particular record only. Here when the record is locked by one program, the other program can modify records other than the one locked.

For option 1

Use the FM ENQUEUE_E_TABLEE to lock the table and FM DEQUEUE_E_TABLEE to unlock table.

For option 2

Go to SE11. There enter the name of your lock object and create it. Next screen you have to mention which field you want to lock.

For more info. on LOCK OBJECTS go to

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

0 Kudos

Dear Experts,

To conclude, am i right to say that depending on the method used, concurrent updation by various programs (same or different) is possible as long as the keys updated are different.

And, am i right to say also that when 1 program is updating a table, if another same program tries to update the table, the program does not need to wait (eg. batch job delay) for the 1st program to completely finnish updation and concurrent updation is possible, depending on the method used?

Best regards

Bass