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 Vendor Invoice with Asset Posting

Former Member
0 Likes
2,842

Hi All,

When I create a vendor invoice with an asset posting using transaction FB60, 2 documents gets created which are linked to each other, one for Vendor invoice and an other related to Asset posting. ( Posting key 31 - Vendor and posting key 70 - Asset)

Now how can I achieve this with the BAPI BAPI_ACC_DOCUMENT_POST?


I pass ACCOUNTGL with the asset details

and ACCOUNTPAYABLE with the vendor details

and ACCOUNTTAX and CURRENCYAMOUNT with the respective values I get a successful return message with a document number, but when I look for the document I can find it anywhere. I am calling BAPI_TRANSACTION_COMMIT after my BAPI call.

Is there any other values that I need to pass to the BAPI? will this BAPI create both the documents?

Any help is appreciated!

Thanks

Elan

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,651

Could you elaborate on


When I create a vendor invoice with an asset posting using transaction FB60, 2 documents gets created which are linked to each other, one for Vendor invoice and an other related to Asset posting. ( Posting key 31 - Vendor and posting key 70 - Asset)

Do you mean "item" when you wrote "document"

You got no error message in RETURN parameter,

  • Was some error raised during commit/update (SM13)
  • Which values did you pass to the BAPI (OBJ_TYPE = BKPFF and BUS_ACT = RFBU?)
  • Did you use WAIT option in COMMIT, or did you select the document from database just after the commit without waiting for database update?

Regards,

Raymond

Could you elaborate on


When I create a vendor invoice with an asset posting using transaction FB60, 2 documents gets created which are linked to each other, one for Vendor invoice and an other related to Asset posting. ( Posting key 31 - Vendor and posting key 70 - Asset)

Do you mean "item" when you wrote "document"

You got no error message in RETURN parameter,

  • Was some error raised during commit/update (SM13)
  • Which values did you pass to the BAPI (OBJ_TYPE = BKPFF and BUS_ACT = RFBU?)
  • Did you use WAIT option in COMMIT, or did you select the document from database just after the commit without waiting for database update?

Regards,

Raymond

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,652

Could you elaborate on


When I create a vendor invoice with an asset posting using transaction FB60, 2 documents gets created which are linked to each other, one for Vendor invoice and an other related to Asset posting. ( Posting key 31 - Vendor and posting key 70 - Asset)

Do you mean "item" when you wrote "document"

You got no error message in RETURN parameter,

  • Was some error raised during commit/update (SM13)
  • Which values did you pass to the BAPI (OBJ_TYPE = BKPFF and BUS_ACT = RFBU?)
  • Did you use WAIT option in COMMIT, or did you select the document from database just after the commit without waiting for database update?

Regards,

Raymond

Read only

0 Likes
1,651

Hi Raymond,

Thanks for the help, I did not mean item, I meant document. 2 accounting documents are created. One for Vendor invoice and the other one is related to the Asset Transaction.

I did not get any error in the return parameters. Infact, I get a success message with the document number.

I just checked SM13 and found my update request in error, and the error says the newly created document number already exists in the company code

But the document does not exist when I look for it in any of the tables. I will continue looking for the reason the update has failed. Any more suggestions/ help is more welcome.

Thanks,

Elan

Read only

0 Likes
1,651

What is the exact error message, if related to actual document number you could look for customization/number ranges, else for duplicate invoice checks or existing parked document?

Regards,

Raymond

Read only

0 Likes
1,651

Hi Raymond,


Note 2128832 solved my problem.


Thanks,

Elan