CDS views in SAP HANA: Explaination and overview
CDS views are virtual data models of SAP HANA that allow direct access to underlying tables of the HANA database. They are defined using a Data Definition Language (DDL) and can be enriched with annotations to provide additional metadata. CDS views aim to push logic from the application server to the client-side and database1. To create a CDS view, you need to use the HANA studio or the ABAP development tools in Eclipse.
Follow Some Steps for CDS views in SAP HANA:
- Create a DDL source file under the package or subpackage of your choice.
- Define the CDS view using the DEFINE VIEW statement and specify its name, parameters and source entities.
- Specify the fields to be exposed by the CDS view using the SELECT clause. You can also use expressions, joins, filters, aggregations and other SQL features.
- Optionally, add annotations to the CDS view or its elements to provide additional information or enable specific features. Annotations start with the @ sign and follow a namespace:value syntax.
- Activate the CDS view to generate an underlying database view that can be accessed via SQL or OData.
Here is an example of a simple CDS view that selects some fields from the SFLIGHT table
@AbapCatalog.sqlViewName: 'ZFLIGHT_CDS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Flight CDS View'
define view ZFlight_CDS as select from sflight {
key carrid,
key connid,
key fldate,
seatsmax,
seatsocc
}
For more info contact with SAP Partner!
Comments
Post a Comment