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: 

Can BAPI_ACC_DOCUMENT_POST post A/P document type KN to multiple orders?

Former Member
0 Kudos
132

We have been using an old BDC program to post documents to A/P. It uses transaction f-43. After an upgrade and requested enhancement there are a number of problems with using this program:

1. It won't post to multiple company codes within one document.

2. All line items get charged to the order number of the last line item.

I think we need to rewrite this interface to no longer use BDC processing. I was looking at BAPI_ACC_DOCUMENT_POST to replace the call to transaction f-43. So I have a number of questions:

1. Am I on the right track?

2. Can BAPI_ACC_DOCUMENT_POST post document type KN?

3. Do I need to use table ACCOUNTGL to post to PM orders and internal orders? If so, can I post to multiple orders on one document?

4. Is there any chance you could provide a sample program that posts documents of type KN? There are a number of source code examples available for document type KR but none of KN.

Thanks in advance for your help.

Laura Andrews

1 REPLY 1

mvoros
Active Contributor
0 Kudos
34

Hi,

1. Definitely, BDC sucks.

2. BAPI_ACC_DOCUMENT_POST is most generic BAPI. SO it should be possible to post document with type KN. I would suggest to have a look at more specific BAPI BAPI_ACC_INVOICE_RECEIPT_POST. I am not sure if this BAPI is suitable for your case. You can have a look at all BAPI_ACC_*.

3. In case of BAPI_ACC_INVOICE_RECEIPT_POST you need to fill table ACCOUNTGL. I don't see any reason why you should not be able to enter different orders for different lines. I haven't tested it.

4. You should be able to find some examples here on SDN.

Cheers