SAP Knowledge Base Article - Public

3688205 - "CAST of type FLTP to type DEC is not possible" when creating a Custom CDS View

Symptom

Error message "CAST XXX of type FLTP to type DEC is not possible" is displayed when creating a calculation inside a Custom CDS View to convert FLTP to DEC using Cast function. 

Environment

SAP S/4HANA Cloud Public Edition

Cause

This type of conversion is not handled by CAST. You can use FLTP_TO_DEC to convert FLTP data types to DEC data type.

Resolution

Use the following function in your calculation:

FLTP_TO_DEC( field as abap.dec(len,decimals) )

Keywords

decimal, DEC, FLTP, CAST, calculation, decimals, function, cds view, custom , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem

Product

SAP S/4HANA Cloud Public Edition all versions