Aggregation Functions in CDS Views
Example 1:
@AbapCatalog.sqlViewName: 'ZVB_TEST_VIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Test cds'
define view ZVB_TEST_CDS
as select from ekpo
{
key ekpo.ebeln as PO_Number,
count(distinct ekpo.ebelp) as Item_count,
min(ekpo.ebelp) as Min_PO_item,
max(ekpo.ebelp) as Max_PO_Item,
sum(ekpo.netpr) as Price
}
group by
ekpo.ebeln
Output:
Example 2:
@AbapCatalog.sqlViewName: 'ZVB_TEST_VIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Test cds'
define view ZVB_TEST_CDS
as select from ekko
inner join ekpo on ekko.ebeln = ekpo.ebeln
{
key ekko.ebeln as PO_Number,
@Semantics.currencyCode: true
ekko.waers as currency,
sum(ekpo.netwr) as price
}
group by
ekko.ebeln,
ekko.waers
Output:
Comments
Post a Comment