‎2010 Jul 08 3:23 PM
Hi,
I have a function which uses BAPI_MATERIAL_BOM_GROUP_CREATE to create a BOM. After calling this function module i am doing a explicit commit by using COMMIT WORK AND WAIT.
Now, when i try to read the data immediately after the commit statement, sometimes i get the newly created contents and sometimes not. It happens once in a while. But this is really affecting the functionality of my function module. Can anyone tell me what could be the problem ? Is it related to SAP server load ? What could be other alternatives ?
Thanks in advance,
Srinivas.
‎2010 Jul 08 3:29 PM
If you use COMMIT WORK AND WAIT the update should be synchronous. This is what SAP documentation has to say;
... If the addition AND WAIT is specified, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
[http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm]
But sometimes in the forum i have seen members having similar problems though.
BR,
Suhas
‎2010 Jul 08 3:36 PM
Hi,
Usually when you add WAIT, control will wait for the update. Introduce explicit wait of 3-4 seconds.
WAIT UP TO 4 SECONDS.
Thanks,
Vinod.
‎2010 Jul 08 3:43 PM
Vinod,
I am not sure if explicit wait of 3-4 seconds guarantees that update goes smoothly in all conditions. Assume a production server whose load is pretty high. I want to be very definite about this update as this really affects the entire transaction.
Thanks,
Srini.
‎2010 Jul 08 4:25 PM
Hi,
We had similar issue with triggering of sequential IDOCs.
eg: First IDOC creates material, next creates class characteristics.
We added a WAIT for 5 seconds in characteristics creation FM (Since it is IDOC, time doesn't matter to great extent). Issue got resolved.
I hope your BASIS team will take care of load balancing (May be with multiple application servers) and appropriate number of work processess as per average system load.
Thanks,
Vinod.
‎2010 Jul 08 3:49 PM
‎2010 Jul 08 3:55 PM
REA,
Saw the code. Didn't find much differences. It also includes the single statement of COMIMIT WORK AND WAIT. Then, it returns the error messages, if any. Lastly,it deletes the buffer.
Do you think this will fix the problem ? Anyways, i will give a shot.
Thank,
Srinivas.
‎2010 Jul 28 9:55 AM
Hi Srinivas,
use commad SET UPDATE TASK LOCAL prior to your BAPI call,
then BAPI will use current LUW for Update.
Regards
REA
‎2010 Jul 29 1:10 PM
REA,
I fixed the problem by adding a explicit wait of 2 seconds in a while loop which runs for 20 times so that irrespective of server load the read call gets data. The moment it is able to read data the control comes out of loop.
I will try to test your solution. It is very informative. I was looking for something like this for quite some time.
Thanks !!
Thanks,
Srini.