on 2024 Dec 13 1:17 PM
I have an SAPUI5 application that is based on an FIORI Elements Overview Page template.
One of my cards on the OVP shows an KPI header with the following values:
We recently upgraded our system from S/4 2020 SP3 to S/4 2023 SP1. This included updating SAPUI5 libraries from 1.84.6 to 1.120.0. After the upgrade, the deviation calculation shows a wrong value. Before it worked as expected.
<Annotation Term="UI.DataPoint" Qualifier="DataPointDurchschnittLieferverzug">
<Record Type="UI.DataPointType">
<PropertyValue Property="Title" String="{@i18n>datapoint_title_durchschnitt_lieferverzug}" />
<PropertyValue Property="Description" String="{@i18n>datapoint_title_durchschnitt_lieferverzug}" />
<PropertyValue Property="Value" Path="AvgDelivToCmtdDelivDelayInDays" />
<PropertyValue Property="CriticalityCalculation">
<Record Type="UI.CriticalityCalculationType">
<PropertyValue Property="ImprovementDirection" EnumMember="UI.ImprovementDirectionType/Minimize" />
<PropertyValue Property="ToleranceRangeHighValue" Decimal="3" />
<PropertyValue Property="DeviationRangeHighValue" Decimal="5" />
</Record>
</PropertyValue>
<PropertyValue Property="TrendCalculation">
<Record Type="UI.TrendCalculationType">
<PropertyValue Property="ReferenceValue" Path="AvgDlvToCmtdDlvDelayPast365Day" />
<PropertyValue Property="UpDifference" Decimal="1" />
<PropertyValue Property="StrongUpDifference" Decimal="2" />
<PropertyValue Property="DownDifference" Decimal="-1" />
<PropertyValue Property="StrongDownDifference" Decimal="-2" />
</Record>
</PropertyValue>
<PropertyValue Property="ValueFormat">
<Record Type="UI.NumberFormat">
<PropertyValue Property="NumberOfFractionalDigits" Int="1" />
</Record>
</PropertyValue>
</Record>
</Annotation>
Request clarification before answering.
After discussing the issue with one of the developers of the framework, a fix was released in the latest patch level 28 (SAPUI5 version 1.120.28). The deviation calculation now behaves as expected again.
See this note to update to a newer patch level: https://me.sap.com/notes/3155948
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess I found the problem. The calculation of the deviation happens in the Frontend in sap.ovp.cards.Annotation-Helper.js. The following line was added in this function:
function returnPercentageChange(iKpiValue, iTargetValue) {
//...
if (typeof iKpiValue == "string") {
iKpiValue = NumberFormat.getIntegerInstance().parse(iKpiValue);
}
//...
}Since the KPI and Target values are retreived from the backend, they are read from the JSON response and will always be of type "string". Regardless of the actual type of the KPI, this code will always convert it to an integer. This causes two problems:
The combination of these two problems will cause the weird deviation values.
I do not know why this line was added by SAP and why an Integer Conversion is used. Unlike the KPI value, the Target value is just converted to decimal using an implicit conversion...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.