SAP ABAP CDS View – Catalog Annotations

In ABAP Core Data Services (CDS) views, the catalog annotations (@AbapCatalog) define important properties related to how the view is created, stored, and used in the database.


🔹 Common @AbapCatalog Annotations

AnnotationPurpose
@AbapCatalog.sqlViewNameDefines the technical SQL view name in the database.
@AbapCatalog.compiler.compareFilterOptimizes filter conditions for better performance.
@AbapCatalog.preserveKeyPreserves the key fields in the database view.
@AbapCatalog.buffering.modeDefines the buffering mode (None, Single, Full).

🔹 Example: Defining a CDS View with Catalog Annotations

@AbapCatalog.sqlViewName: 'ZDEMO_CDS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.buffering.mode: #FULL
define view ZDEMO_CDS as select from sflight {
key carrid,
key connid,
fldate,
price
}

🔹 Explanation:

Creates a technical SQL view named 'ZDEMO_CDS' in the database. ✅ Enables filter optimization for better performance. ✅ Enables full buffering to improve data retrieval speed.


🔹 Buffering Modes in CDS Views

ModeDescription
#NONENo buffering (default).
#SINGLEBuffers individual table rows.
#FULLBuffers the entire table for faster access.

🔹 Use buffering carefully, as it affects database performance and memory usage.


🔹 Key Benefits of @AbapCatalog Annotations

✅ Control technical properties of the database view. ✅ Improve performance with optimized filters and buffering. ✅ Ensure compatibility with database-level configurations.