Skip to Content
0

BAPI_ACC_DOC_POST not posting TAX data same as online Transaction

Oct 27, 2017 at 07:52 AM

211

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
Former Member

Any helpful comments from community members ...

0
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Avik Mazumder Nov 02, 2017 at 06:35 PM
0

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

Show 1 Share
10 |10000 characters needed characters left 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.

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

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.

Share
10 |10000 characters needed characters left characters exceeded
G Lakshmipathi
Oct 27, 2017 at 08:25 AM
0

You need to follow the Solution provided in OSS note 561175

Show 1 Share
10 |10000 characters needed characters left 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)
0
avatar image
Former Member Nov 02, 2017 at 03:43 AM
0

ABAP/MM experts, please help !

Share
10 |10000 characters needed characters left characters exceeded
Avik Mazumder Nov 02, 2017 at 06:35 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Jelena Perfiljeva
Nov 02, 2017 at 06:30 PM
0

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.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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.

0
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.

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

Hi Experts, Any comments will be very helpful here.

Share
10 |10000 characters needed characters left characters exceeded