cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOC_POST not posting TAX data same as online Transaction

Former Member
0 Kudos

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.

Former Member
0 Kudos

Any helpful comments from community members ...

Accepted Solutions (1)

Accepted Solutions (1)

former_member365886
Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Experts, Any comments will be very helpful here.

former_member365886
Contributor
0 Kudos

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

Jelena
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Thanks Jelena. I have done extensive search on forum before posting. I understand that BAPI n Transaction doesn't behave in same manner as BAPI can't calculate tax and needs to be fed. We are aware of this and passing tax to the bapi in required format and getting expected results for all tax scenarios except US/Canada (which use external tax calculation).

E.g. Canada - Issue is that it uses Acct Key VS1/VS2 etc in system which is marked as non-deductible. Due to this as shown in my original post, BAPI ignores tax line totally. But transaction is able to show Tax line. I can't believe it is expected as processing/calling way can be different but ultimate result should be still same.

Please go through the original post details and do provide if you have any inputs, thanks.

Diwakar

Jelena
Active Contributor
0 Kudos

I've read the original post but I'm not sure what kind of response you're expecting from SCN on this. We can't change the standard code, sorry.

Former Member
0 Kudos

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.

Former Member
0 Kudos

ABAP/MM experts, please help !

Former Member
0 Kudos

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.

Lakshmipathi
Active Contributor
0 Kudos

You need to follow the Solution provided in OSS note 561175

Former Member
0 Kudos

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.