Skip to Content
avatar image
Former Member

BAPI_ACC_DOC_POST not posting TAX data same as online Transaction

Hi Experts,

I am facing a strange issue and it is only happening only for US/Canada Taxes via vendor invoice postings(where external tax calculation is on via Vertex). When I do it via transaction -> FB01, F-43 etc, with tax calculation flag on, there is no issue, tax line is posted fine in Accounting doc.

Now as per new requirement, I need to post accounting document via program (BAPI or BDC) since data will be coming from other system. I am using BAPI_ACC_DOC_POST for accounting document postings and it is working fine for all scenarios except US/Canada. Tax calculation is working fine, I feed the tax amounts to this BAPI.

Example Canada case, issue I am facing is tax data is totally ignored by this bapi...so I am getting error "balance in transaction currency" if I post gross amount - 1200, Item amount 1000 and tax 200........if I post gross amount 1000, item amount 1000 and tax 200, then document is successfully posted without any tax info ....hence BAPI is just ignoring the tax line....I am entering the Jurisdiction code etc all well as required. ...

Finally after debugging the BAPI, I found out that tax is getting ignored due to "Tax acct key" for this tax code is VS1, in our system config VS1 is non-deductible tax in OBCN. As per BAPI code, for non-deductible tax (mainly written for for NVV/NAV), field KSTAT is marked as X. And there is a logic that if KSTAT is X, then delete the tax line simply. I am checking internally with functional team that why Canada tax have VS1 and why VS1 is marked as non-deductible flag. But anyhow, this is very old setting and unlikely to change. Most strange thing here is that if I do exactly same posting using FB01, then tax item is posted fine with a separate line.

So issue here is how come BAPI and Transaction are behaving differently. Whatever be the config, both should behave in same manner.

If this is not resolved, then we might have to move to BDC instead of BAPI which will be major re-test effort for all other scenarios.

Posting via FB01 direct -->

OBCN -

BAPI standard code -

Tax data getting deleted-

Any help is appreciated, please ask if you need more details.

5.jpg (81.8 kB)
6.jpg (32.2 kB)
7.jpg (122.9 kB)
8.jpg (92.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    Nov 02, 2017 at 06:35 PM

    Hi,

    Please follow this blog to realize your requirement.Now- a-days I am irregular to SCN due to personal obligation.

    You should be able to get your solution with the help of good ABAP consultant following this blog.

    https://blogs.sap.com/2017/06/23/fi-posting-via-idoc-and-generate-additional-tax-line-in-accounting/

    Regards,

    Avik

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Avik, Thanks for response. Blog is on similar lines, but doesn't touch the exact solution we are looking for. Moreover, we are on ECC5 and using BAPI. Issue we are facing is only for a particular scenario where tax is marked as non-deductible in config.

  • avatar image
    Former Member
    Oct 30, 2017 at 05:23 AM

    Hi team,

    Any help will be appreciated, this is critical and urgent issue for us. I am just hoping that a SAP note might help on this. Also, it will be helpful if anyone can just throw some light that what is the impact of marking any tax acct key as "non-deductible" in OBCN.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 27, 2017 at 08:25 AM

    You need to follow the Solution provided in OSS note 561175

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi lakshmi,

      Thanks for looking into it, however the fields which are mentioned to be blank are already blank in our BAPI call. Also we are on ECC 5.0 and seems that note is valid for previous versions.

      9.jpg (170.9 kB)
  • avatar image
    Former Member
    Nov 02, 2017 at 03:43 AM

    ABAP/MM experts, please help !

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2017 at 06:35 PM

    Hi,

    Please follow this blog to realize your requirement.Now- a-days I am irregular to SCN due to personal obligation.

    You should be able to get your solution with the help of good ABAP consulatant following this blog.

    https://blogs.sap.com/2017/06/23/fi-posting-via-idoc-and-generate-additional-tax-line-in-accounting/

    Regards,

    Avik

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2017 at 06:30 PM

    There are very many similar questions on SCN. Google -> BAPI_ACC_DOC_POST tax. This one is just from the top of the list.

    The note mentioned above clearly states that BAPI does not work the same way as transaction.

    Do some research in Google and if it doesn't help then contact SAP Support. Also this pertains to FIN tag, not SD.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jelena,

      I suppose that I am missing something and hence need help on SCN. To summarize my issue, BAPI is not able to post any non-deductible tax. There are many notes and threads available on the same (unluckily I haven't found my solution yet), so I don't suppose that BAPI is unable to post non-deductible tax at all.

      So I don't think is the SAP standard code issue, definitely something I am missing.

  • avatar image
    Former Member
    Nov 10, 2017 at 07:56 AM

    Hi Experts, Any comments will be very helpful here.

    Add comment
    10|10000 characters needed characters exceeded