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
Annotation | Purpose |
---|---|
@AbapCatalog.sqlViewName | Defines the technical SQL view name in the database. |
@AbapCatalog.compiler.compareFilter | Optimizes filter conditions for better performance. |
@AbapCatalog.preserveKey | Preserves the key fields in the database view. |
@AbapCatalog.buffering.mode | Defines 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: #FULLdefine 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
Mode | Description |
---|---|
#NONE | No buffering (default). |
#SINGLE | Buffers individual table rows. |
#FULL | Buffers 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.