I can't access our system right now, but i will try to summarize my issue :
We are making a vendor document posting via bapi BAPI_ACC_DOCUMENT_POST.
In customizing (FTXP), we have a tax code 'AM', containing 2 percentages rates :
Input tax VST 10,5 120 100 MWVS
Non deduct.input tax NVV 10,5 140 100 MWVZ
We filled the tables for the bapi (accountgl, accountpayable, accounttax, currencyamount).
Particularly for this tax code, we filled the last line of currency amount with the base_amount (amt_base 800) and amount tax (amt_doccur 84).
We also filled a line in accountax (linked with the same itemno_acc) to specify the condition type of the tax -> MWVS with a tax_rate.
BAPI is well executed and a document is created and we see (FB03) the item lines and the tax line at the bottom, good 😊
But when we take a look at BSET table, we have a first line with transaction type VSF (NWMS), but too another line with transaction type NVV (MWVZ) (seems logic because it is in the custom calc procedure), but with a base amount of 884 (base + tax values? ...), and a tax amount of 42 (half of first line tax !
I don't know how SAP added the line for the condition MWVZ, because we didn't filled a second line in the accounttax table for condition...
I tried to debug the BAPI, and found at a point the table XBSET, already filled with these value; but couldn't find where this was calculated/filled by SAP.
Does someone would be so kind to guide us in finding how and why SAP give these amounts please?
Thank you in advance and best regards,