Skip to Content
Apr 21 at 12:10 PM

SAPUI5 Input currency not validating decimal point for JPY

76 Views Last edit Apr 24 at 12:26 PM 4 rev

I've setup an input field as a currency type, and also included error handling by adding the following to the manifest.json

 "handleValidation": true,
<Input value="{parts: ['pendingData>/data/netPrice', 'pendingData>/data/currency'], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false} }" id="pendingNetPriceInput"  change="onInputChange"/> 

This works fine for GBP for example, correctly showing an error when inputting an invalid character.

However, when the currency is JPY, this should not allow entry of a decimal point, which is an invalid character for this currency, but SAPUI5 is not showing the error in this case.

I've checked the TCURX table in ECC and JPY is set to 0 decimal places.

Why is the decimal point not erroring for JPY?

Note. I have also tried adding in the sap:variable-scale annotation to the metadata.... as described here. OData annotations in SEGW with example and consume it in visual studio to create a fiori application | SAP Blogs

.... with no success unfortunately.. The decimal point remains on JPY currency (scale 2).