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
- Go to "Custom CDS Views" app
- Open the Custom CDS View
- Add a new calculation
- Click on "Check" or "Publish"
- 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