Skip to Content
-4

Multiple users executing the same program at same time and multiple equipment's getting created

Mar 19 at 10:10 AM

99

avatar image

Hello,

The program accepts a excel file and creates equipment.My issue is when multiple users execute the program at the same time,it creates multiple equipment's for the same record combination.

Let's say file has 2 records and 2 users are running the program at same time.

Now program will create 2 equipment's for 1st record and 2 equipment's for 2nd record.A total of 4 equipment's are getting created instead of 2.

I do not want this to happen and do not want to lock the program. I still want to allow multiple users to run the program at the same time and if first record is already processed by one user it should be skipped in another processing and should continue with other record.Please help me in solving this issue.

10 |10000 characters needed characters left characters exceeded

Can some one throw some light on using 'INDX' table during run time to check whether record is processed in another session or not?

0

What happens if user one runs the program and then user two runs the program? You'll still get 2 equipments for the first record and 2 equipments for the second, won't you?

Why are two users loading the same excel at the same time anyway.

Your scenario is somewhat strange.

0
Matthew Billingham

2 equipment's are created for the first record only when both the users start execution at same time. Yes,scenario is strange.This situation is not frequent though but when this situation arises program should be in a position to process as explained.

0

I think you'd be well advised to read up again on the SAP locking concept and lock objects.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeny Gubenko Mar 19 at 10:35 AM
1

Hi!

Do you use lock objects in the processing? If you use INDX table, you can also lock it by FM ENQUEUE_ESINDX so this will prevent other users from processing the entry.

Hope it's helpful

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi,

I haven't used any lock objects.Could you please let me know, how can I make use of 'INDX' table?

My plan is to check whether entry exists in INDX table and if exists skip the record but not sure on what basis should I check the records from INDX table.What values to be passed in the key fields in order to check a particular record exists in INDX table?

0

Your plan is effectively replicating what enqueue does for you. Create your own lock object with approprirate keys so the same equipment cannot be created twice.

1

Yes Mike.Locking works.Thank you.

0
Himanshu Gupta
Mar 21 at 09:50 AM
0

Hi Pavan,

I assume from your query that you are Migrating the data and creating equipment in bulk.

As you said it created 2 different equipment if run in parallel ,I assume you are using the internal number range.

To fix it , you can create a Z table that can hold the record of identification from excel file. if that record is present then any other program with same set of record won't process it.

Regards

Himanshu

Show 4 Share
10 |10000 characters needed characters left characters exceeded

There is an issue with this solution as well Himanshu.

What if the same program running in parallel sessions try to insert the same record in the table at same time?

0

There is no Z-table needed. Follow Matthew's advice and familiarise yourself with locking. This is one of the fundamental concepts of data processing since databases were invented.

4

Hi Sai,

For that the key field would be your identification number . As it is key field you cannot insert two value at the same time. This way it won't create an issue.

Creating a table will also help you identify the total record that has been proceed successfully and you may not need to rectify or create new delta file to rerun.

if you are using External number then obviously you don't need any solution .

1

Hi Himanshu,

Thank you for your thoughts.

0
Pavan Sai Kumar Apr 05 at 06:32 AM
0

Hi Matthew,

Thank you and locking works.

Share
10 |10000 characters needed characters left characters exceeded