Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST and BAPI_TRANSACTION_ROLLBACK

Former Member
0 Kudos
2,083

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.

4 REPLIES 4

0 Kudos
458

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.

Jens-K
Product and Topic Expert
Product and Topic Expert
0 Kudos
458

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

Former Member
458

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

Former Member
0 Kudos
458

Thanks