Skip to Content
avatar image
Former Member

Issue in BAPI_ACC_DOCUMENT_POST for one taxcode, multiple tax lines

Hi Experts,

I am facing issue while doing a Financial posting via BAPI using a tax code with multiple condition types. To avoid redundant answers, let me add more details -

1. I know how to pass tax data in this BAPI and normal tax postings are working fine where 1 tax code is 1 conditing type (1 rate).

2. Only issue is in BAPI when 1 tax code is having multiple condition types (3 different rates). Example B1 tax code. If I use same tax code in FB01, it works fine, I enter only 1 time B1 tax code, nothing else, no GLAcc, no Acc key etc ...FB01 auto posts 3 lines in document for tax data with all 3 rates properly applied.

3. My scenario is that tax is calculated from different system outside SAP and hence I cant use 'Calculate_Tax_XXX' functions in SAP. I only have tax code B1 and 3 tax amounts(suppose 100$,5$,5$). Don't have Gl account or Acc key etc....

4. If I pass 3 lines in ACCOUNTTAX table with B1 and 3 corresponding lines for tax data in CURRENCYAMOUNT, I get error in BAPI. If I total the tax amounts (150$) and pass only 1 line for tax data in CURRENCYAMOUNT, still same error.

5. In a way, I already know the solution that if I pass 'Acct_Key' values also in ACCOUNTTAX table, then BAPI posts fine. But since my tax data is coming from an external system which doesn't have Acct_Key value, I am unable to pass this field. What I am unable to understand is that if FB01 can auto split B1 taxcode and 150$ tax amount in 3 lines in document, then why BAPI cannot do it.

BAPI error -

Posted directly by FB01, just gave B1 and 150$ as tax amount -

I have read many threads already posted on similar lines but didn't get any solution. Please provide inputs, thanks.

1.jpg (161.7 kB)
2.jpg (85.5 kB)
3.jpg (40.0 kB)
4.jpg (98.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Sep 18, 2017 at 07:13 AM

    Experts, Any advice/suggestion on it will be highly appreciated.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 18, 2017 at 08:46 AM

    Did you try to set the ACCT_KEY value to value like 'VST', 'MW1' or 'MW2' Or even map results of CALCULATE_TAX_FROM_GROSSAMOUNT to your tax items in the ACCOUNTTAX parameter.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2017 at 09:41 AM

    Hi Raymond,

    Thanks for reply. As I had written earlier, I already know that if I pass ACCT_KEY in BAPI in ACCOUNTTAX table, then posting works fine as expected.

    But since tax is calculated from external system ARIBA, they dont have that ACCT_KEY info. Hence is there a way that BAPI could work without such info, since FB01 can work without it.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Raymond,

      OK understand, you mean that there is no way to make it work without feeding any extra information to BAPI.

      Let me try and see if I can get GL acc for these tax components from Ariba and then using that GL account + tax amount, I can retrieve Acc key from SAP and pass to BAPI.

      I was just hoping that I might be missing anything and BAPI can work without passing any Acc key since FB01 can work that way. Thanks for your valuable inputs.

  • avatar image
    Former Member
    Sep 19, 2017 at 02:53 AM

    Any suggestion from anyone. Looking for a solution on this asap.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2017 at 04:39 AM

    Any help will be appreciated, if something is not clear, please feel free to ask.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 21, 2017 at 08:10 AM

    Hi Diwakar,

    In ACCOUNTTAX parameter pass G/L account and account key for all three tax components. With out passing account key and G/l account BAPI will not work

    Add comment
    10|10000 characters needed characters exceeded