Quantcast
Channel: SCN : Popular Discussions - ABAP in Eclipse
Viewing all articles
Browse latest Browse all 1215

CDS view association[1..1] - INNER JOIN

$
0
0

Hello experts.


I'm practicing with new views CDS.

I have a question.

A "association [1..1] " is the same as a" INNER JOIN "??

* association [1..1]  -> The association has one target instance

 

I have this CDS view with INNER JOIN:

@AbapCatalog.sqlViewName: 'ZCDS_AS_001'

define view Zcds_Assoc_001 as

 

select from kna1 as k

    inner join adr6 as a

    on k.adrnr = a.addrnumber

    {

       key k.kunnr,

       k.name1,

       k.adrnr,

       a.addrnumber,

       a.smtp_addr

 

     }

This CDS view returns only records that have results in both tables.

 

CDS_VIEW_INNER.png

 

 

But when I use "association [1..1] " instead of INNER JOIN, the CDS view behaves like LEFT OUTER JOIN!!!

 

@AbapCatalog.sqlViewName: 'ZCDS_AS_001'

define view Zcds_Assoc_001 as

 

select from kna1 as k

    association[1..1] to adr6 as a

    on k.adrnr = a.addrnumber

    {

       key k.kunnr,

       k.name1,

       k.adrnr,

       a.addrnumber,

       a.smtp_addr

 

     }

 

CDS_VIEW_LEFT.png

How can I program  CDS  with associations for act  like a INNER JOIN??

 

Thanks


Viewing all articles
Browse latest Browse all 1215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>