Ansicht
Dokumentation
ABENABAP_SQL_PATH_FILTER - ABAP SQL PATH FILTER
Vendor Master (General Section) ABAP Short ReferenceThis documentation is copyright by SAP AG.
- Path Expressions, attributes
... [ $[(n$|*) $[INNER$|${LEFT$|RIGHT OUTER$}$]$] $[$[WHERE$] sql_cond$] ] ...
Additions
1. ... (n$|*)
2. ... INNER$|${LEFT$|RIGHT OUTER$}
3. ... $[WHERE$] sql_cond
Effect
Attributes for a section of a path expression can be specified in square brackets for every CDS association or CTE association _assoc of the path expression specified in a data source of a FROM clause or a column specification. The following can be done using these attributes:
- The cardinality of the section can be declared
- The type of the join expression can be specified
- A filter condition sql_cond can be specified
Addition 1
... (n$|*)
Effect
The cardinality of the current association _assoc is declared by specifying a number n or the character * is specified in parentheses ( ). The numbers 1 and 2 can be specified for n. Specifying the cardinality overwrites the definition of the cardinality [min..max] or TO ONE$|MANY of the current association with "to 1", "to 2", or "to *".
- The cardinality can be specified to prevent syntax warnings or syntax errors in cases where the cardinality of the association does not match the way it is used in a path expression of a SELECT statement or affects the way it is used.
- If (1) is specified, a LEFT OUTER JOIN is defined implicitly using the addition MANY TO ONE on database systems that support this, and the consequences of this should be noted.
Note
If the cardinality is specified in a path expression, the syntax check is performed in strict mode from Release .
Example
Paths specified with an explicitly specified cardinality of CDS associations in the SELECT list.
If supported by the database, only the left outer join between the DDIC database tables SPFLI and SAIRPORT
is defined using the addition MANY TO ONE.
Addition 2
... INNER$|${LEFT$|RIGHT OUTER$}
Effect
This addition defines the join type into which the current association _assoc is transformed:
- INNER specifies an inner join
- LEFT$|RIGHT OUTER specifies a left outer join or a right outer join
The join type can only be specified together with the cardinality.
If the join type is not specified explicitly, the type depends on the place where the path expression is used:
- When columns are specified in SELECT statements, a LEFT OUTER JOIN is used.
- An INNER JOIN is used as a data source of the FROM clause.
Note
If the type of the join is specified in a path expression, the syntax check is performed in strict mode from Release .
Example
Path specifications with an explicitly specified cardinality and a switch of the left outer joins to inner joins in the columns specified in the SELECT list.
Addition 3
... $[WHERE$] sql_cond
Effect
Specifies a filter condition sql_cond for the current association _assoc. The addition WHERE is optional in cases where the filter condition is the only item specified in the square brackets. The addition must be specified if one of the other additions is used first.
When the association is resolved in a join, the filter condition is converted to an extended condition for the join. If no filter condition is specified in the path expression, the default filter condition defined using WITH DEFAULT FILTER is used in the case of a CDS association.
Columns specified in the filter condition sql_cond always refer to the target target or target of the association for which the condition is specified. An explicit name must not and cannot be specified with the column selector ~ in front of a column specification.
Notes
- The relational expressions that can be used in a filter condition are a subset of the relational expressions for statements, but also allow SQL expressions as operands on the right side.
- If a filter condition is specified in a path expression, the syntax check is performed in strict mode from Release .
Example
Specification of filter conditions in a path expression.
rdisp/max_wprun_time - Maximum work process run time CL_GUI_FRONTEND_SERVICES - Frontend Services
This documentation is copyright by SAP AG.
Length: 8083 Date: 20240329 Time: 141122 sap01-206 ( 113 ms )