ABAP CDS on HANA-5

cds JOINs in CDS View

 

 

 

In ABAP CDS, Join between two data sources is allowed. Allowed joins are:-

  • Inner Join/Join
  • Left Outer Join
  • Right Outer Join

The post shows a simple Inner Join between data sources form SCARR & SPFLI table.

In HANA studio, open ABAP perspective. From Project explorer, right click on the package and choose New->Other ABAP Repository Object

1

Choose DDL Source & select Next

2

Provide a name & description & select finish

3

Provide aSQL View Name & code lines. Save & Activate.

4


@AbapCatalog.sqlViewName: ‘ZFLIGHT_JOIN’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Flight with Inner Join CDS View’

define view Zflight_Join_Vw
                      as select from spfli
                      join scarr
                     on spfli.carrid = scarr.carrid
{
   key spfli.carrid,
   key scarr.carrname,
   key spfli.connid,
  spfli.countryfr,
  spfli.cityfrom,
  spfli.airpfrom,
  spfli.countryto,
  spfli.cityto,
  spfli.airpto
}


Execute it or by right click choose Data Preview.

5

Output:

6


 

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