ABAP Core Data Services and Data Modeling
21% - 30% of the examWhat this topic covers
Create reusable CDS view entities to model data and associations without duplicating source data. Use calculated elements, currency annotations, hierarchies, and access control to shape and protect data for consumers.
How does a CASE expression in a CDS view handle a zero denominator?
A CASE expression checks the denominator inside the database before the division runs, so a zero value returns a fallback result instead of an error. Wrap the calculated element in an explicit CAST to control its result type and precision. For example, use CASE WHEN cost = 0 THEN 0 ELSE margin / cost END.