Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FULL OUTER JOIN with ABAP CDS

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

5 REPLIES 5

sathyags
Active Participant
0 Kudos

Have you tried UNION ?

0 Kudos

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.

sathyags
Active Participant
0 Kudos

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

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

CROSS JOIN?

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abencds_f1_joined_...

I know it is a difference, but maybe it is what you need?

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/