I'm using BAPI_ACC_DOCUMENT_POST to create invoices from a vendor interface flat file (we do not want to use BDCs).
I'm not sure how to populate the tax codes? The total invoice tax is indicated on the invoice header level. Some line items are taxable and others not, but I don't know which line items have tax and which not. Besides DOCUMENTHEADER, I populate the first line with negative total amount in ACCOUNTPAYABLE table with ITEMNO_ACC of 10. All line items are then populated in ACCOUNTGL table. I then list the Tax/VAT as the last line item in ACCOUNTGL. But I never indicated the tax codes. Now that I attempt this, I'm running into all sorts of trouble. I think that ACCOUNTTAX table is only used if you actually want the tax to be listed separately per line item. In our case in transaction F-43 we don't set the checkbox to true for Calculate Tax. We just enter the tax code and capture the line items, the last being a separate line item for tax. So now I'd appreciate it if someone could tell me how to do this? If I only enter ACCOUNTGL entry and input the tax code, the RETURN table indicates that a corresponding tax entry is expected. If I enter a corresponding tax entry I get an error that the tax code I'm using is wrong for the GL Account. And it expects the tax entry to be a calculated amount per line item.
If this is too complicated to achieve with the BAPI, I'll revert to a BDC, but it would be great to get this working with the BAPI.
Best regards, Adrian
Edited by: Adrian Bruwer on Jul 26, 2011 11:56 AM