CDS View Entity vs Classic CDS View
Understand the practical difference between modern CDS view entities and older classic CDS views.
Explanation
Classic CDS views create a generated SQL view name and use the define view syntax. CDS view entities use define view entity and do not require a separate SQL view name. For new ABAP development on supported releases, view entities are generally preferred because they are cleaner and more modern. Many older systems and existing projects still contain classic CDS views, so consultants must understand both. In interviews, do not just say one is old and one is new. Explain generated SQL view, syntax difference, release dependency and new-development preference.
Code example
// Classic CDS style usually required SQL view name annotation.@AbapCatalog.sqlViewName: 'ZV_SO_OLD'@EndUserText.label: 'Classic Sales Order CDS'define view ZI_SalesOrderOld as select from vbak{ key vbeln, auart, vkorg} // Modern CDS view entity style.@EndUserText.label: 'Sales Order View Entity'define view entity ZI_SalesOrderEntity as select from vbak{ key vbeln as SalesOrder, auart as SalesDocumentType, vkorg as SalesOrganization} // Practical point:// In supported S/4HANA systems, prefer view entity for new development.// Existing classic CDS views may still remain in older codebases.Real project scenario
A migration project kept existing classic CDS views but created all new reporting models as CDS view entities to align with modern S/4HANA development standards.
Common mistakes
- Using classic CDS syntax for all new development without checking release. - Confusing CDS entity name with SQL view name. - Not knowing why @AbapCatalog.sqlViewName exists in older CDS. - Assuming all systems support view entities.
Best practices
- Use view entities for new development where supported. - Understand older classic CDS in existing systems. - Avoid unnecessary SQL view dependency in new models. - Check system release and project standard.
Interview angle
Interviewers may ask view entity vs classic CDS. Mention syntax, generated SQL view and modern preference.