Application Development and Automation 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: 
Read only

bapi_acc_document_post not posting

Former Member
0 Likes
8,861

Hello Everybody,

I hope I'm in the right location, I'm not sure what is going on here with all this new stuff. In either case...

I'm using BAPI_ACC_DOCUMENT_POST to create postings, obviously. The problem I'm having is that the return from the BAPI says that the document is being posted but it doesn't exist if I search for it in transaction FB03.

1) I've called BAPI_ACC_DOCUMENT_CHECK first to make sure the attributes are OK.
2) I call BAPI_ACC_DOCUMENT_POST next to actually post the document.
3) I use 'BAPI_TRANSACTION_COMMIT' to push any changes to the database.

I've also looked in table BKPF with the document number that is returned by the BAPI. I've also put this entries in and called the BAPI from SE37 with BAPI_TRANSACTION_COMMIT after. It all says succesful but it's not to be found. I've been trying to search for a solution and I keep coming across unanswered posts and also people that have said "I've solved it, bye!" without explaining what they've done.

Any help at all would be great, thanks for your time!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,787

Hi,

Check the values being returned by BAPI in OBJ_TYPE, OBJ_KEY, OBJ_SYS parameters. You are checking the correct values in OBJ_KEY in FB03 with correct year and company code. The OBJ_SYS is the system in which you are checking the document. Check whether there is any update termination occured in SM13. Also try giving wait = X in BAPI_TRANSACTION_COMMIT.

8 REPLIES 8
Read only

Former Member
0 Likes
6,787

Hi Bryan,

While commiting work using BAPI_TRANSACTION_COMMIT, are you setting the importing parameter wait = 'X'?

Thanks & Regards,

Sam

Read only

0 Likes
6,787

Hi Samir,

Yes wait is set to true.

Read only

former_member222709
Contributor
0 Likes
6,787

Hi Bryan,

Since you have tried all the possible combinations with reference to ABAP, I suggest you verify the transaction by executing it manually. If the entries are getting posted, then, try reversing the document 'BAPI_ACC_DOCUMENT_REV_POST'. The systems error might be helpful.

Regards,

Pranav.

Read only

0 Likes
6,787

Hi Pranav,

I did not try this but the fields were not valid. Maybe this can be done for the next person that comes across this thread with a similar problem.

Read only

Former Member
0 Likes
6,788

Hi,

Check the values being returned by BAPI in OBJ_TYPE, OBJ_KEY, OBJ_SYS parameters. You are checking the correct values in OBJ_KEY in FB03 with correct year and company code. The OBJ_SYS is the system in which you are checking the document. Check whether there is any update termination occured in SM13. Also try giving wait = X in BAPI_TRANSACTION_COMMIT.

Read only

0 Likes
6,787

Hi,

Try testing the bapi in se37 with a sequence test followed by BAPI_TRANSACTION_COMMIT.

Also, Try manually creating the document with the same data.

Read only

Former Member
0 Likes
6,787

Are you calling the function modules (in sequence) through the report program or you are executing them through SE37? If you are executing through SE37, you should create a test sequence for these FMs in the order mentioned above before executing.

If you are calling the function modules through the program, the return structure will return the document number generated. (RETURN-MESSAGE_V2+0(10)).

Regards, Vinod

Read only

Former Member
6,787

Hello everybody,

Thanks again for you time everybody. I managed to solve it. First I'll say what I tried:

1) Created a test run in SE37 with BAPI_TRANSACTION_COMMIT at the end. The return was successfully posted, but it wasn't showing up in the tables.
2) I've created a seperated program where I manually filled the properties in to the tables, almost same as above just in an ABAP report.

What my coworker found was:
1) I was using the wrong field. I was using AMT_BASE instead of AMT_DOCCUR.
2) There are two itemno being used, 40 and 50, 40 for debit and 50 for credit.
3) I figured the BAPI should automatically handle the math, but I had to set the '50' value to negative to cause the debit and credit to 0 balance.

The postings are now showing up. I however still find it strange that this BAPI doesn't report this.