Hi,
I need to create a CDS view using UNION to get records from 2 tables, TAB1 and TAB2 like below.
I do not want to have duplicate records with same key. So if records with same key exist in TAB1 and TAB2 it should take from TAB1. How should CDS view look like?
define view entity ZI_TEST as select from ZTAB1 as ZTAB1
{
key ZTAB1.keyfield as Keyfield,
ZTAB1.valuefield as Subarea
}
union select from ZTAB2 as ZTAB2
{
key ZTAB2.keyfield as Keyfield,
ZTAB2.valuefield as Subarea
}