Ansicht
Dokumentation
ABENCDS_F1_HAVING_CLAUSE - CDS F1 HAVING CLAUSE
Addresses (Business Address Services) BAL_S_LOG - Application Log: Log header dataThis documentation is copyright by SAP AG.
- SELECT, HAVING
... HAVING cond_expr ...
Effect
Defines a HAVING condition for the result set of a CDS view after a GROUP BY clause is evaluated. A HAVING condition can only be specified together with GROUP BY. Special rules apply when specifying the condition.
Removes all rows from the result set that do not meet the condition cond_expr specified after HAVING.
Note
Aggregate expressions can be specified in the HAVING condition, which is not possible in the WHERE condition.
Example
When accessed, the CDS view sales_order returns the number of business partners for each business partner role in which the total gross amount in euros is greater than 100000.00.
-
@AbapCatalog.sqlViewName: 'SALES_ORDER_VW'
define view sales_order as
select from snwd_so
inner join
snwd_bpa on buyer_guid = snwd_bpa.node_key
{ key bp_role as role, //e.g. customer or supplier
count(distinct buyer_guid) as partners_count,
sum(snwd_so.gross_amount) as sum_gross_amount }
where snwd_so.currency_code = 'EUR'
group by bp_role
having sum(snwd_so.gross_amount) > 100000.00;
ROGBILLS - Synchronize billing plans BAL Application Log Documentation
This documentation is copyright by SAP AG.
Length: 2798 Date: 20240417 Time: 214356 sap01-206 ( 33 ms )