New generation CDS: CDS View Entity

5
CDS View Entity

The New-born: CDS View Entity

With ABAP release 7.55, a new type of CDS view is available: in official terminology, it’s called CDS view entity. And it has come to replace the “classic” CDS DDIC-based views that have been around for years.

CDS DDIC-based viewCDS view entity
@AbapCatalog.sqlViewName: ‘ZCDSVSCARR’
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_ALLOWED
define view zcds_scarr_spfli
as select from spfli
join scarr on scarr.carrid = spfli.carrid
{
key spfli.carrid as id,
key scarr.carrname as carrier,
key spfli.connid as flight,
spfli.cityfrom as departure,
spfli.cityto as destination
}
.
.
.
.
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view entity zcds_scarr_spfli_e
as select from spfli
join scarr on scarr.carrid = spfli.carrid
{
key spfli.carrid as id,
key scarr.carrname as carrier,
key spfli.connid as flight,
spfli.cityfrom as departure,
spfli.cityto as destination
}

Differences:

  • The view entity doesn’t require the annotation @AbapCatalog.sqlViewName.
  • The view entity doesn’t require the annotation @AbapCatalog.compiler.compareFilter: true because the filter is implicitly and automatically compared.
  • The view entity doesn’t require the annotation @ClientHandling.algorithm since client handling takes place implicitly.
  • The view entity doesn’t require the annotation @AbapCatalog.preserveKey: true because there’s no ABAP Dictionary view attached to a CDS view entity.
  • The view entity is defined using the statement DEFINE VIEW ENTITY.

CDS View entity is the future of CDS View but its not going to replace DDIC-based view Sonner. If we see the benefits its worth trying. ABAP on Cloud or RAP already using CDS view entities instead of DDIC-based View.

Leave a Reply

Your email address will not be published.

You may use these <abbr title="HyperText Markup Language">html</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*