Skip to content

ABAP Keyword Documentation →  ABAP Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Views →  ABAP CDS - DDL Statements →  ABAP CDS - DEFINE VIEW →  ABAP CDS - SELECT →  ABAP CDS - SELECT, association →  ABAP CDS - path_expr 

ABAP CDS - path_expr, attributes

Other versions: 7.31 | 7.40 | 7.54

Syntax


... [ [1:] [INNER|{LEFT OUTER} [WHERE]] [cond_expr] ] ... 

Extras

1. ... 1:
2. ... INNER|{LEFT OUTER} [WHERE]
3. ... cond_expr

Effect

A CDS view of the ABAP CDS attributes for this part of the path expression can be defined in square brackets for every association assoc of a path expression. Using these attributes:

  • the section with 1: can be declared as monovalent,
  • the type of join expression can be specified
  • a filter condition cond_exp can be specified

The outer square brackets are part of the syntax.

Addition 1

... 1:

Effect

If the 1: is specified, the current association is not declared as polyvalent. The addition makes it possible to use filter conditions in path expressions, which are used in WHERE clauses or HAVING clauses. The addition overwrites the cardinality of the association in this type of clause.

The addition 1: cannot be listed as the only addition in square brackets.


Note

The addition prevents a syntax error, if a path specification with filter conditions or with a quantity value cardinality is used in a WHERE clause or HAVING clause. A check is not to performed to determine whether the condition is monovalent at runtime.

Addition 2

... INNER|{LEFT OUTER} [WHERE]

Effect

Definition of the type of join expression where the current expression is implemented:

  • INNER is an inner join
  • LEFT OUTER is a left outer join

If the type of join expression is not explicitly specified, then the type depends on the place where the path expression is used:

  • After FROM, it is an inner join.
  • In all other locations, it is a left outer join.

If the type of join expression is defined before filter condition cond_expr, the addition must be specified before addition WHERE. If this is not the case, WHERE cannot be specified.

Addition 3

... cond_expr

Effect

Filter condition for the current association. A filter condition is a condition cond_exp that is implemented when resolving the relevant association in a join in an advanced condition for the join. Special rules apply when specifying the condition.


Note

The predefined annotation AbapCatalog.compiler.compareFilter can be used to specify whether the filter conditions are compared for the path expressions of a view. If the filter condition matches, the associated join expression is evaluated only once, which generally improves performance. Otherwise a separate join expression is created and evaluated for each filter condition. However, the results sets of both configurations can differ.