2011 Nov 28 11:15 AM
Hi All,
I'm using BAPI: BAPI_ACC_DOCUMENT_POST to post the cross company document to others system.
I tried test the BAPI with test run mode without commit it. The BAPI able to return the document number posted (eg:5000001).
When I perform the second time test run again to this BAPI, the document no. get increased even earlier steps I did not commit it. I also have using the BAPI_Transaction_Rollback, however, the document no. still get increasing. Could anyone advise on this is there any reason the number keep increase even ? Thank you.
2011 Nov 28 12:42 PM
Hi,
Is this BAPI can run with test run mode? I didn't see any test run parameter.
I think, if you want to test run an account document posting you can use BAPI_ACC_DOCUMENT_CHECK first.
Hope this help.
Tiwa N.
2011 Nov 28 12:50 PM
Hi Blue Sky,
the BAPI BAPI_ACC_DOCUMENT_POST will retrieve a number from the number range via e.g. function module RF_GET_DOCUMENT_NUMBER. In the moment you retrieve the number, the number is consumed. But you can reset the number range via FBN1. In column number level you can define the last consumed number.
Kind regards,
Jens
2011 Nov 28 1:15 PM
Hi
The account document number is got just before calling the COMMIT (I mean the abap code to get the number is not in a process working in UPDATE TASK), so if you don't call the COMMIT the result will be the document won't be created but the number will be lost.
If you want to get back the lost number you need to manage directly the range by setting the last number (but nobody has to post a document while you're setting the range).
So if you want to test you program before posting a document finally you can use BAPI_ACC_DOCUMENT_CHECK
Max
2011 Dec 20 1:55 AM