on 2021 Sep 16 5:55 PM
Hello guys!
We have a requirement to display a quantity field formatting the decimals accordingly unit of measure configuration in a report built using Fiori Elements, like the COOISPI:
COOISPI transaction:

In this transaction the decimals of the target quantity are formatted using the unit of measure configuration, the unit HL has 3 decimals and the UoM PC doesn't have decimals.
In the list reports built using Fiori Elements, the quantity column is always with 3 decimals like the domain of this field:

In the CDS we are using the annotations below:
@EndUserText.label: 'ProducedQuantity'
@Semantics.quantity.unitOfMeasure: 'UnitMeasure'
a.ProducedQuantity as ProducedQuantity,
@UI.lineItem: [{position: 110}]
@EndUserText.label: 'UnitMeasure'
@Semantics.unitOfMeasure: true
a.UnitMeasure
Is there a way to format the decimals in the column quantity based on the unit of measure configuration in Fiori Elements?
Best regards,
Alessandra
Request clarification before answering.
I was looking for the same problem, and I found these solutions:
Both mention a "scaling" annotation.
For example:
@UI.dataPoint: {
title: 'Unit Price',
description: 'Name',
valueFormat: {
scaleFactor: 1000,
numberOfFractionalDigits: 1
}
}
Price;I hope I can help someone else by giving this late answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jan,
with both solutions you're providing, were you able to meet Alessandra requirement?
From what I understood and is also my requirement, we want the configuration to be respected, meaning if the UoM does not have decimals it shouldn't show decimal places (Like PC), instead of always showing the same number of decimal places (3 in this case).
If I create a freestyle app, with sap.m.table or sap.ui.table it works as expected but I was able to replicate this behavior with sap.ui.comp.smarttable.
Anyone knows if this is a known issue of Fiori elements smart table? And if so, any workaround?
Thanks,
Jorge
Hello Jorge,
You are right, with the solutions I provided it is not referring to the UoM but always using a fixed amount of decimals. Thanks for pointing this out!
Have a nice day,
Jan-Willem
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.