‎2020 Jun 22 12:22 PM
Hi Team,
I am getting error " Inconsistent currency information " in BAPI BAPI_ACC_DOCUMENT_POST.
I got the requirement to pass local currency as well to the BAPI but i am getting above error in existing code after adding my code.
i am getting error for second record ( as per below Screenshot ), USD is my header text currency if i change it to local currency in debug mode i.r PHP then it is working fine.

.Can anyone help me with this.
‎2020 Jun 23 7:05 AM
Hi Marek,
This ITEMNO_ACC '0000000002' is for account tax.
My question is if i don't pass CURR_TYPE = 10 and CURRENCY 'PHP' for this particular record,
why dont it calculate automatically the local currency.
If i pass local currency for any record then is it mandatory to pass local currency for all recirds in currency table.
‎2020 Jun 22 1:08 PM
Hi 101257251592
what you must archive is thatthe subtotal per Currency Type (CURR_TYPE) in all of the lines of your internal table GT_CURRENCY must be 0. This makes sure that debit = credit in document and accounting document is correct.
Please make sure that:
1) You deliver currency type in each line. Currency type for document currency is 00.
2) Each ITEMNO_ACC exists in table twice - once with currency type 00 (document currency) and once with currency type 10 (local currency)
So your entry for currency type should be (example for line 1):
first line:
ITEMNO_ACC = 0000000001
CURR_TYPE = 00
CURRENCY = USD
AMT_DOCCUR = 555577.8480-
second line:
ITEMNO_ACC = 0000000001
CURR_TYPE = 10
CURRENCY = PHP
AMT_DOCCUR = amount in PHP also with minus like 11555577.8480-
In your example you have 3 times line 1 referenced - that is incorrect - it should be only 2 times and line 2 should be existing also 2 times and not once.
Please also do not mix the currencies - once you have CURR_TYPE = 10 with value PHP and once with USD.
Regards,
Marek
‎2020 Jun 22 1:34 PM
Thanks Marek.
But there's code written in program were FM "CALCULATE_TAX_FROM_GROSSAMOUNT" has been used to calculate GrossAmount .
CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'
EXPORTING
i_bukrs = lwa_accountgl-comp_code
i_mwskz = lwa_accountgl-tax_code
i_txjcd = lwa_accountgl-taxjurcode
i_waers = gwa_icjv_header-waers
i_wrbtr = lv_wrbtr
i_taxps = lwa_accountgl-itemno_tax
IMPORTING
e_fwste = lv_fwste
TABLES
t_mwdat = lt_mwdat
IF sy-subrc = 0.
IF lv_taxes_item IS NOT INITIAL.
lwa_accountgl-itemno_tax = lwa_accountgl-itemno_acc.
ENDIF.
IF lv_fwste IS NOT INITIAL.
lwa_currency-amt_doccur = lwa_currency-amt_doccur - lv_fwste.
ENDIF.
LOOP AT lt_mwdat INTO lwa_mwdat.
lv_count = lv_count + 1.
lwa_currency_tax-itemno_acc = lv_count.
lwa_currency_tax-currency = gwa_icjv_header-waers.
lwa_currency_tax-amt_doccur = lwa_mwdat-wmwst.
lwa_currency_tax-amt_base = lwa_currency-amt_doccur.
APPEND lwa_currency_tax TO gt_currency.
CLEAR lwa_currency_tax.
ENDLOOP.
ENDIF.
So it is appending the amount three times
1. Local currency
2. Header currency
3. For gross amount with header currency
before adding my local currency code it was working fine, below is the Screenshot of table currencyamount before adding my code :
‎2020 Jun 22 1:47 PM
Sorry but FM CALCULATE_TAX_FROM_GROSSAMOUNT calculates the tax amounts only but you need to have the values in CURR_TYPE = 10 for each line of the accounting document and not for tax lines as well.
PS. There is no screenshot in your second answer.
‎2020 Jun 22 2:03 PM

Above screenshot of currency table before adding my local currency table, it was working fine.
The entry of ITEMNO_ACC = '0000000002' is of tax amount, which was working before adding my code.
but after addition of local currency logic it is not working it is giving error " Inconsistent currency information ".
‎2020 Jun 22 2:19 PM
That is correct and see that there is only one currency, total of AM_DOCCUR is 0 for that one currency.
What you need to make sure is that each line which you see in the working version has a duplicated line with CURR_TYPE = '10' and CURRENCY = 'PHP' and amounts in fields AMT_DOCCUR and AMT_BASE are passed in PHP.
Maybe you can share your code?
Marek
‎2020 Jun 23 7:05 AM
Hi Marek,
This ITEMNO_ACC '0000000002' is for account tax.
My question is if i don't pass CURR_TYPE = 10 and CURRENCY 'PHP' for this particular record,
why dont it calculate automatically the local currency.
If i pass local currency for any record then is it mandatory to pass local currency for all recirds in currency table.