Get Example source ABAP code based on a different SAP table
• HAVING ABAP_CDS_SELECT
ABAP_CDS_DDL - CDS View Entity, SELECT>, HAVING>
ABAP_SYNTAX ... HAVING cds_cond> ... >
What does it do? Defines a HAVING> condition for the result set of a CDS view entity> after a GROUP BY> clause> is evaluated. A HAVING> condition can only be specified together with GROUP BY>. The HAVING> condition removes all rows from the result set that do not meet the condition cds_cond> specified after HAVING>. If the view entity makes use of multiple data sources> by using join expressions, then all fields listed after HAVING> must be prefixed with the name of their data source separated by a period (.). The prefix is required in all cases, even if the field names are unique. The following rules apply to the condition specified after HAVING >:
As relational operators, comparison operators, LIKE>, and IS [NOT] NULL> can be used. BETWEEN> and IS INITIAL> are not supported.
The Boolean operators NOT>, AND>, and OR> are allowed.
lhs> can be a field> of a data source data_source>>, a path expression>, an aggregate expression>, a case expression>, or an arithmetic expression>.
rhs> can be an element> of the SELECT> list>, an aggregate expression>, a literal>, a parameter>, a path expression, a case expression>, or an arithmetic expression>. ABAP_EXCEPTION when using the operator LIKE>, then rhs> must be a character literal.