SAP CDS SELECT CLAUSES V1



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS_DDL - DDIC-Based View, SELECT, clauses

ABAP_SYNTAX
... $[WHERE cds_cond$]
$[GROUP BY field1, field2, ...$]
$[HAVING cds_cond$]
$[UNION $[ALL$] SELECT ...$] ...

What does it do?
The optional clauses of the SELECT statement of a ABAP_CDS_V1_VIEW have the following semantics:
The WHERE clause restricts the rows in the result set when the CDS view is accessed.
The GROUP BY clause groups rows in the result set when the CDS view is accessed. It is applied after rows are selected using the WHERE clause.
The HAVING clause restricts the result set further after a GROUP BY clause. Here, aggregate expressions can be specified in the condition.
UNION can be used to create the union of the result sets from two SELECT statements.



Latest notes:

CDS views do not support ORDER BY for the following reasons:
Historic reason: Some database platforms that support ABAP CDS do not support ORDER BY in views.
Undefined behavior may occur when ORDER BY is used in multiple views within a view stack.
Undefined behavior may occur in complex views that, for example, join multiple data sources and use an ORDER BY clause.
NON_V5_HINTS
ABAP_HINT_END