‎2007 May 18 4:57 AM
Idocs are sent from external system to SAP. There are no of Idocs and each Idoc posting a document in SAP.
For posting a document Idoc inbound FM reads the previous document posted and do some calculations for the current document and posts it.
Now the problem is it's not recoginizing the document posted immediately but it's taking previous document for calculations which is causing problem. For example doc1,doc2,doc3 are posted in sequence. Doc3 Idoc processing should read doc2 values but it's reading doc1 values.
I wanted to know is there possibility that Idocs are processed parallelly? is there possibility that doc3 Idoc processing started before commiting doc2 changes? How to correct this. I am using standard FM MEASUREM_DOCUM_RFC_SINGLE_001 to post document.
This problem was not there earlier. We have recently introduced delay if the point is locked to wait for 3 secs and retry to avoid failure due to locking.
Any ideas much appreciated.
Thanks,
Srinivas
‎2007 May 18 5:46 AM
Hi Srinivas,
Could you tell me as to from where are you reading the previously posted document's data. I suggest that if you read the data form the EDIDS table, which gives the status of the most recently posted idoc. In that way you could identify the most recently posted idoc's data.
The second option could be that when posting idoc2, you take the relavant data you need for processing idoc3 and store it in a temporary database table. then when posting idoc3, you read the data from Z table, do calculations and post idoc3 and also update the z table with latest info.
Hope this helps,
Revert in case of any queries.
Reward points if helpful.
Karan
‎2007 May 18 6:03 AM
Hi Karen,
Thanks for the reply.
There is FM MEASUREM_DOCUM_READ_LAST_BUF available to read last document. We are not reading Idoc data but document data posted.
Thanks,
Srinivas.
‎2007 May 18 6:18 AM
In this case the only option feasible (as it seems from the way you have described your problem ) is to either introduce more delay before calling the FM you specified, or explicitly doing "COMMIT WORK" before reading the FM. This would then update the database immediately. Each time before you read the data of the previously posted document, try doing commit work. Even if then it doesnt help , then the only way possible is to read the idoc data and status record.
Cant reading the idoc data itself solve your problem or do you need the document to be posted and only then you want to perform some calculations? even if you want the no. of document posted, you can get it from idoc status (EDIDS) table.
Hope this helps,
Reward if useful.
Karan