SAP Knowledge Base Article - Public

2804928 - Custom field of data type DecimalValue does not display values which amount to less than 1

Symptom

Your PDI field, which is suppose to display a result of some calculation defined in your custom script, does not show any value, when the result itself amounts to a value less than 1, for example 0.5 or smaller.

Environment

  • SAP Cloud Application Studio
  • SAP Business ByDesign
  • SAP Cloud for Customer 

Reproducing the Issue

As a prerequisite you have previously:

  1. Created a custom solution in Cloud Application Studio.
  2. Created either a Custom Business Object or extended Standard Business Object.
  3. Defined an element of data type DecimalValue similar to the below example:

  [Decimal(10,4)][Label("ABC")] element DEF : DecimalValue; (where ABC refers to the label of the custom field visible in the UI, and DEF refers to the name of the element in the backend)

  1. Created a custom script where you are performing some calculation and assign result to your field of datatype DecimalValue.
  2. After executing your custom logic you notice that this custom field does not display any value, when calculation is equal to less than 1.

Cause

The reason as to why you are seeing an empty field is due to incorrectly maintained property in the UI designer. This field is marked as DisplayEmptyString, under property "Display Behavior on Zero" within properties tab. System considers any value less than 1 as zero, therefore since the condition is satisfied no value is shown in the UI.

DisplayEmptyString.png

Resolution

You need to maintain this property as DisplayValue. Please bare in mind, that if the solution is already deployed, you are no longer able to maintain any changes in the UI designer. Please create a Patch and carry on with necessary adjustments.

Keywords

DecimalValue, Display Behavior on Zero, DisplayValue, Ui designer, unable to see values less than 1 , KBA , AP-RC-UIF-RT , UI Framework Runtime , Problem

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions