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

inserting values in a data dictionary table with out losing data

Former Member
0 Likes
546

Hello All,

I have some issues with updating a table. The program works fine. But problem arrives when two users try to run the program at the same time. I am getting only one update in the table. The other data is getting lost. This happens only when both users try to update at the same time. I am using following statement:

INSERT dbtab FROM TABLE itab.

How I can lock the dbtab while it is being used by one user , so that I do not lose data from second user? Can I create some type of queue so that while one user is writing the data to dbtab, the other user data get queued up and when dbtab is available, this queued data can be written to it.

Thanks for the help in advanced!

3 REPLIES 3
Read only

Former Member
0 Likes
502

Create a Lock Object for that Table and use the Relevant Enque Deque functions that you generate.

That would help you

Vinodh Balakrishnan

Read only

Former Member
0 Likes
502

Hi,

You can aplly the concept of locking for this.

Please refer to the document:

http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm

Hope this helps. Pls reward poins if useful.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
502

Hi,

When two users trying to update the same table then it is problem.

So u need to use Logical Locks which are created at SE11-> locks

Which consist entries like table name and fields by which u need to lock that table.

Also have lock type s- shared, x- exclusive and c- cumulative.

Here in u r case use type X or C.

Then while it activated it create two function module 1. EnqueueE<name> and

2. DEqueueE<name> .

In program while updating data base use:-

Call Function ‘EnqueueE<name>’

Exporting

……

Then modifying data base statements.

Then

Call Function ‘DEqueueE<name>’.