cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST skips document number and returns wrong value

0 Kudos

Hi,

i'm using the bapi "bapi_acc_document_post" with the .Net Connector and it works really great except for one point: The bapi always skips one documentnumber and returns a wrong number.

For example:

Last Documentnumber: 10005
Bapi returns: 10006
Inserted: 10007

I'm using RfcTransaction.commit()
How is that possible?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Found the solution here: LINK

   public void Commit(IRfcFunction bapi)
        {
            RfcSessionManager.BeginContext(dest);

            var commitBapi = repo.CreateFunction("BAPI_TRANSACTION_COMMIT");

            bapi.Invoke(dest);
            commitBapi.Invoke(dest);

            RfcSessionManager.EndContext(dest);
        }

Answers (1)

Answers (1)

iklovski
Active Contributor
0 Kudos

Hi,

What are the buffer settings for RF_BELEG number range? Also, are you working by any chance with two (or more) app servers on your site?

Regards,

Eli

P.S. Additionally, please check this OSS note: 1372327 - Document number gaps for BAPI_ACC_DOCUMENT_POST

0 Kudos

The bapi creates the document successfully. But the gaps are there anyway.
I think that it has something to do with the transaction from the rfc call.

Is that possible?

iklovski
Active Contributor
0 Kudos

If the object (RF_BELEG) is buffered, then gaps are possible. You have to switch off the buffering.