SAP Knowledge Base Article - Public

3232547 - Expression type ARITHMETIC not allowed in function GET_NUMERIC_VALUE while trying to create a calculation in a Custom CDS View.

Symptom

Error message "Expression type ARITHMETIC not allowed in function GET_NUMERIC_VALUE, parameter 1" while trying to add a calculation in a Custom CDS View. 

Environment

SAP S/4HANA Cloud 

Reproducing the Issue

  1. Go to "Custom CDS Views" app
  2. Open the Custom CDS View 
  3. Add a new calculation
  4. Click on "Check" or "Publish"
  5. Error message is triggered
 

Cause

This error message is coming from the usage of a calculation within the brackets of the function GET_NUMERIC_VALUE.

Example: "GET_NUMERIC_VALUE(I_ExampleCDSView.Example * (-1))"

In this case, the "arithmetic" expression is exactly the calculation where we multiplies I_ExampleCDSView by "-1". The multiplication by "-1" must be outside GET_NUMERIC_VALUE similar to this:

GET_NUMERIC_VALUE(I_ExampleCDSView.Example) * (-1)

Resolution

To resolve this issue, you'll need to check the logic and if there's any calculation inside the "GET_NUMERIC_VALUE" brackets you'll need to put it outside. 

Keywords

Expression type ARITHMETIC not allowed in function GET_NUMERIC_VALUE, calculation, Custom CDS View, calculated field, GET_NUMERIC_VALUE, publish, check. , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions