‎2018 Mar 19 10:10 AM
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.
‎2018 Mar 19 10:35 AM
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
‎2018 Mar 19 10:17 AM
Can some one throw some light on using 'INDX' table during run time to check whether record is processed in another session or not?
‎2018 Mar 19 10:35 AM
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
‎2018 Mar 19 11:12 AM
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?
‎2018 Mar 19 11:17 AM
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.
‎2018 Apr 05 7:33 AM
‎2018 Mar 19 11:18 AM
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.
‎2018 Mar 19 11:19 AM
I think you'd be well advised to read up again on the SAP locking concept and lock objects.
‎2018 Mar 19 11:49 AM
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.
‎2018 Mar 21 9:50 AM
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
‎2018 Mar 27 6:59 AM
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?
‎2018 Mar 27 9:08 AM
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.
‎2018 Mar 27 10:43 AM
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 .
‎2018 Apr 05 7:32 AM
‎2018 Apr 05 7:32 AM