Skip to Content
1
Nov 19, 2015 at 04:10 PM

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

6528 Views

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.

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

}

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

Thanks

Attachments

CDS_VIEW_LEFT.png (25.6 kB)
CDS_VIEW_INNER.png (14.0 kB)