Symptom
- In Fiori Launchpad, the KPI Tile is failing with error "Cannot load tile" and nothing happens when you click on it to open.
- In Browser Console there's the following error message: "Database returned the SQL code 314. Error text: numeric overflow: convert from XXX to YYYY type at \"to_YYY\" function (at pos X)"
For example: Database returned the SQL code 314. Error text: numeric overflow: convert from 1939 to TinyInt type at \"to_tinyint\" function (at pos 0)
Environment
SAP S/4HANA Cloud
Cause
There's a casting function where the actual numeric value exceeds the underlying data type (e.g. in a function or CDS view).
Following the example in "Symptom" tab, the Custom CDS View has a field with the following Calculation: "cast( '1' as ABAP.INT1 )". The ABAP.INT1 converts the data into TINYINT.
Resolution
To resolve the issue you'll need to use a cast function that allows a bigger numeric value.
For the example in "Symptom" tab, will be needed to to use "ABAP.INT2" or "ABAP.INT4" instead.
TINYINT The TINYINT data type stores an 8-bit unsigned integer. The minimum value is 0 and the maximum value is 255. (This is Cast to ABAP.INT1)
SMALLINT: The SMALLINT data type stores a 16-bit signed integer. The minimum value is -32,768 and the maximum value is 32,767. (This is Cast to ABAP.INT2)
INTEGER: The INTEGER data type stores a 32-bit signed integer. The minimum value is -2,147,483,648 and the maximum value is 2,147,483,647. (This is Cast to ABAP.INT4)
See Also
Keywords
Fiori Launchpad, KPI Tile, Cannot load tile, nothing happens when you click on the tile, Browser Console, Database returned the SQL code 314, numeric overflow, convert from to type at function, convert from to TinyInt type at \"to_tinyint\" function (at pos 0), ABAP.INT2, ABAP.INT4 , KBA , CA-GTF-SB-S4H-DT , SAP Smart Business S4H - Design Time , CA-FLP-ABA , SAP Fiori Launchpad ABAP Services , Problem