ABAP CDS on HANA-14

cdsConsumption CDS View

 

 

 

The post describes about how to create a consumption view. A consumption view basically build upon a basic or composite view.

In this process will create:-

  1. A basic view on a DB table
  2. A Consumption view on the basic view 

Creation of Basic View

1.jpg

 

 

 

 

 

 

 


@AbapCatalog.sqlViewName: ‘ZFLIGHTVW1’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Basic Airline View’
@VDM.viewType: #BASIC
@Analytics.dataCategory: #DIMENSION
define view Zflight_View1 as select from scarr
{
key scarr.carrid as AirlineID,
scarr.carrname as AirlineName,
@Semantics.currencyCode: true
scarr.currcode as AirlineCurrency
}


Data Preview

4.jpg


Creation of Consumption view on basic view- which is oData publish enabled2.jpg


@AbapCatalog.sqlViewName: ‘ZFLIGHTVW2’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Consumption Flight View’
@VDM.viewType: #CONSUMPTION
@OData.publish: true
define view Zflight_View2 as select from Zflight_View1
{
key Zflight_View1.AirlineID,
Zflight_View1.AirlineName,
Zflight_View1.AirlineCurrency
}


Data Preview

3.jpg


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s