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 function nothing posts

Former Member
0 Kudos
398

Hi,

I am trying to post a document of type DR (simulating transaction FB70) using BAPI_ACC_DOCUMENT_POST function.

The function returns success code (605) and the message that document was successfully posted but indeed it is not in the database. I have tried to call this BAPI from ABAP program and from non-SAP system using RFC enabled wrapper function that calls this BAPI. I need this wrapper function in order to perform some checking routines before calling BAPI. The result was the same. I have tried to debug the code. There are a lot of calls to functions in update mode in BAPI_ACC_DOCUMENT_POST function logic but I was unable to find the commit work statement. It seems, that changes were not committed to the database.

Any help would be very appreciated.

Regards,

Gediminas

1 REPLY 1

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
108

In most BAPIs you have to implicitly trigger the Commit Work by calling BAPI_TRANSACTION_COMMIT. The following is from the online help for this function:

FU BAPI_TRANSACTION_COMMIT

____________________________________________________

Short text

Execute external Commit when using BAPIs

Functionality

This method executes a COMMIT WORK command. It is required for transactions developed externally to the R/3 System that change data in the R/3 System via BAPI calls.

When you call BAPIs in your program that change data in the R/3 System, afterwards you must call this method to write the changes to the database.

Notes

Messages are returned in the parameter 'return'. This parameter documentation contains the return codes and their descriptions.

Further Information

Use the method BapiService.TransactionRollback to prevent changes to the database being committed.