Alternative for WAIT-Statement
I have a problem I'm using a BAPI for reversing an production confirmation. This BAPI creates to a goods movement (MSEG). I make directly after the call of the BAPI a Commit Work (with the BAPI-FM).
So now I have to select the table AFWI which contains the value of the created material document (MSEG-MBLNR). But I do not get the correct number. It seems that I select a temporary-number and after a few seconds then the correct number is saved in the database table. I think the creation of the number is done by the SAP in a V2-execution (asyncron).
But now my question: Which options do I have to get the correct number? For testing I have implemented a WAIT-statement with 2 seconds, but I can not gurantee that this time will always be enough. What if there are may update records to be handled in this time?
What can I do to really always get the correct document number?
Thanks a lot!
Edited by: Max Maier on Oct 12, 2008 3:02 PM