SAP Knowledge Base Article - Public

2810000 - Decimal places for sales price fields

Symptom

  • In Cloud BAdI SD_APM_SET_APPROVAL_REASON or BAdI SD_BIL_APM_SET_APPROVAL_REASON, the field TOTALNETAMOUNT is compared with a value like 50000 which is the net value shown in Fiori app like "Manage Sales orders" or "Manage Preliminary Billing Documents". But the check seems not working.

Environment

  • Sales
  • SAP S/4HANA Cloud

Reproducing the Issue

  1. Open app "Manage sales orders".
  2. Display the sales order with currency TWD. Check the net value. It doesn't have decimal places.
    net price.jpg
  3. Create an implementation of BADI SD_APM_SET_APPROVAL_REASON in app "Custom field and logic".
  4. Write a check like the following:

    If salesdocument-totalnetamount GT 50000 .
         salesdocapprovalreason = 'Z000'.
    endif.

  5. The condition in the IF statement fails. If a trace is performed, you'll see the value of salesdocument-totalnetamount is 500.00 instead of 50000.

Cause

  • The amount (data type CURR), like VBAK-NETWR and  BSEG-WRBTR, is always stored in database tables with two decimal places.
  • Currencies which have no decimal places are stored in database tables with decimal places.
  • In Cloud BAdI SD_APM_SET_APPROVAL_REASON, when comparing the field SALESDOCUMENT-TOTALNETAMOUNT with the value displayed in app, the value is divided by 100 if currency doesn't have decimal places, like JPY, TWD etc.
  • In Cloud BAdI SD_BIL_APM_SET_APPROVAL_REASON, when comparing the field billingprocdocument-totalnetamount with the value displayed in app, the value is divided by 100 if currency doesn't have decimal places, like JPY, TWD etc.

Resolution

Since currency TWD has zero decimal places, internally when saving to database the system divides the value by 100 so that it has 2 decimal places. So when comparing the value in your BADI implementation you need to take this into account.The IF statement should be written like "If salesdocument-totalnetamount GT 500.00 ."

See Also

Similar logic in purchasing is explained in hte following KBA:

1679279 - Wrong decimals places displayed for price fields

Other notes about currency codes:

  • Note 137626 - FAQ: decimal places for currency code
  • Note 434349 - Change of decimal places of currencies
  • Note 126857 - Display of amts with correct decimal places in SE16
  • Note 1240163 - Amount too high by factor of 100 for HUF, JPY currencies

Keywords

currency, decimal place, JPY, TWD, TOTALNETAMOUNT, SALESDOCUMENT, VBAK-NETWR, CURR, SD_BIL_APM_SET_APPROVAL_REASON, SD_APM_SET_APPROVAL_REASON, preliminary billing documents, net value, approval, workflow , KBA , SD-SLS-QUT , Inquiries / Quotations , SD-SLS , Sales , SD-SLS-QUT-2CL , Inquiries / Quotations (Public Cloud) , SD-FIO-BIL , Fiori UIs for Billing , Problem

Product

SAP S/4HANA Cloud all versions