Skip to Content
avatar image
Former Member

BAPI_ACC_DOCUMENT_POST tax

Good day

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 26, 2011 at 10:37 AM

    Hi

    That BAPI doesn't calculate the tax line automatically, you need to do it by yourself, you can use fm like CALCULATE_TAX_FROM_NET_AMOUNT in order to get the tax data.

    The tax line has to be transfer to ACCOUNTTAX only not in ACCOUNTGL

    Max

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      I still don't understand

      F-43 is not magic, it can calculate the tax item from the G/L line where a certain tax code is indicate, else you need to do it manually like the BAPI.

      If you have the amount to be posted, you need to do which are the taxable and untaxable part, that means you should know the vat code for both parts (taxable and untaxable).

      For example:

      It needs to post 1000 Euro, where only 900 are taxable (20%), so you should have:

      Vendor 1 900 tax code 20 (20%)

      Vendor 2 100 tax code 00 (0%)

      Cost 3 - 900 tax code 20

      Cost 4 - 100 tax code 00

      So it needs to calculate the tax line manually and the posting to be transfer to the BAPI should be:

      Vendor 1 1080 tax code 20 (20%)

      Vendor 2 100 tax code 00 (0%)

      Cost 3 - 900 tax code 20

      Cost 4 - 100 tax code 00

      tax 5 - 180 tax code 20

      Max