You have the following CDS definition (aliases shown):
define view entity Z_ENTITY
as select from Z_SOURCE1 as _Source1
association to Z_SOURCE2 as Source2 on ???
{
key carrier_id as Carrier,
key connection_id as Connection,
cityfrom as DepartureCity,
cityto as ArrivalCity,
Source2
}
(The data sources are joined by the field carrier_id. The corresponding field in Z_SOURCE2 is also carrier_id.)
Which ON condition must you insert?
In a CDS view entity defined AS SELECT FROM, the association ON condition must use the source aliases defined in the FROM clause.
$projection is used in projection views (AS PROJECTION ON ...), not in a basic select view entity. Therefore, options using $projection (B, C) are invalid here.
Using global names (Z_SOURCE1, Z_SOURCE2) in the ON (A) ignores the declared aliases and is not the recommended/valid form within the view definition.
The correct ON clause uses the aliases _Source1 and Source2 with the matching key fields:
ON _Source1.carrier_id = Source2.carrier_id (D).
This aligns with CDS modeling rules in RAP: use aliases consistently and model associations with precise ON conditions based on keys.
Study Guide Reference: ABAP CDS Development---Associations & ON conditions; RAP Data Modeling.
Michael
3 months agoCasie
3 months agoPortia
3 months agoLudivina
3 months agoVanna
4 months agoEmogene
4 months agoSusy
4 months agoElena
4 months agoLuisa
5 months agoMarge
5 months agoJospeh
5 months agoNieves
4 months ago