Skip to Content
1

FULL OUTER JOIN with ABAP CDS

Nov 22, 2017 at 06:22 AM

270

avatar image
Former Member

How can I implement a FULL OUTER JOIN in ABAP CDS ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sathya Gunasekaran Nov 22, 2017 at 11:45 AM
0

Have you tried UNION ?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I was thinking about

LEFT OUTER JOIN

UNION

RIGHT OUTER JOIN

but I am not sure if this is the best way to do it.

0

You may want to use 'DISTINCT' to eliminate duplicates!

0
Horst Keller
Nov 22, 2017 at 03:20 PM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you for the suggestion.

While a CROSS JOIN does all combinations of the LHS and RHS, a FULL OUTER JOIN is a UNION of LEFT OUTER and RIGHT OUTER JOINS. I decided to go with the later solution. May not be the best way to do it but I think this is something that one would expect out of CDS views in ABAP given that it is available in HANA.

I can't think of a way to use a CROSS JOIN in lieu of a FULL OUTER JOIN.

Just for the enlightenment of readers, here is a note on FULL OUTER JOIN available in HANA

https://blogs.sap.com/2014/05/25/all-about-joins-using-sql-in-hana/

0