The association & cannot be used locally in the view (see long text)

Message type: E = Error

Message class: SDDL_PARSER_MSG - Message Class for DDL Parser

Message number: 061

Message text: The association & cannot be used locally in the view (see long text)



What causes this issue?

If a locally defined association is used in the selection list of the
CDS view (for example a field of the association target is accessed),
this association is translated directly to a local join. Here, the ON
condition of the association is applied directly to the join ON
condition, which means that the join ON condition may contain invalid
clauses.
This includes situations where the ON condition of the association
contains the following clauses (using $PROJECTION):
Path expression of the selection list
Calculated field
Expressions such as CAST, CASE, or function calls
In these cases, this association cannot be used locally, since clauses
of this type cannot be used in ON conditions of joins.

Error message extract from SAP system. Copyright SAP SE.