SAP Knowledge Base Article - Public

3462373 - Precision and scale decimal property types in Odata service in SAP Analytics Cloud (SAC)

Symptom

  • Odata service metadata may have a decimal column for which customers define precision and scale values as "variable".
  • This is an accepted OData v4 syntax but is not acceptable by the dataset and universal model workflow logic, in the data acquisition backend service.
  • Creating universal models and datasets from the OData service fails, while classic model workflow may finish successfully.

Environment

  • SAP Analytics Cloud (Enterprise) 
  • Import Data Connection to OData service

Reproducing the Issue

Following are the steps to reproduce the issue –

  1. Check the service metadata (by invoking the service metadata endpoint) and confirm the presence of a decimal column for which certain values have been defined for precision and scale that do not directly ascertain to the logic that precision > scale
  2. Create connection to the OData datasource in SAC
  3. Create universal model
    1. Open modeller -> start with empty model (universal model) -> choose created connection -> create new query -> select query -> click on CREATE ->  plugin exception on the ui "The job failed during plugin execution"
  4. Create Dataset
    1. Select from a data source -> choose created connection -> select query -> click on CREATE -> plugin exception on the ui "The job failed during plugin execution"
  5. Create Classic Model
    1. Open modeller -> click on ‘Want to create a classic model (accounts only) instead’? -> choose created connection -> create new query -> select query -> click on CREATE -> query gets successfully created

Cause

  • The cause of this issue can be narrowed down to the usage of “variable” scale and an undefined precision for the decimal type property, in the OData service metadata. For OData V4 Variable Scale is not supported by SAC. But in case it is used as a scale value, then the service plainly interprets it as 0.

  • Problem arises when this decimal property is defined with a variable scale and no precision. The default value in case of an absent precision is taken as -1. So, when for the decimal type property, the precision is -1 and scale is 0, it breaks the ruling in the column type conversion logic that precision > scale. This results in the exception message in the application log and the error on the ui. This problem occurs only in case of dataset and universal model workflows because their implementation logic for column type conversion is separate and different from that of the classic model workflow.

Resolution

To resolve the issue, any of the following suggestions can be adopted. For the decimal type property that has been defined with Scale=variable, the customer can try the following changes in their service metadata -

  1. if scale=variable, then define precision too, with a finite positive integer value
  2. or, define both precision and scale with finite positive integer values
  3. or, omit both precision and scale values
  4. something that also worked was converting the decimal field from integer64 to integer

See Also

Your feedback is important to help us improve our knowledge base.

Keywords

KBA , LOD-ANA-AQU , Import Data Connections (Acquiring Data) , LOD-ANA-AQU-ODATA , Acquiring Data into SAC using an ODATA connection , Problem

Product

SAP Analytics Cloud 1.0