ABAP CDS ON HANA-CDSビューでの集約

Posted yjyongil

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ABAP CDS ON HANA-CDSビューでの集約相关的知识,希望对你有一定的参考价值。

Aggregate expression in CDS View

 

An aggregate expression calculates a single value from an operand operand by calling an aggregate function from multiple rows of a results set. They need Group By clause to aggregate values from multiple rows and  the non-aggregated fields  are specified in the GROUP BY clause.

Aggregate Functions:

技术图片

Created a CDS view with below select with SUM function.

技术图片


@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘Flight View with Aggregation Operation’
define view Zflight_View 
as select from sflight
{
key sflight.carrid, 
key sflight.connid, 
sum( price ) as Total_Amount,
sflight.currency
} group by carrid, connid, currency

  


Data Preview:

技术图片

CDS view with SUM & COUNT functions

技术图片


@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘Flight View with Aggregation Operation’
define view Zflight_View 
as select from sflight
{
key sflight.carrid, 
key sflight.connid, 
sum( price ) as Total_Amount,
sflight.currency,
count( *) as Lines
} group by carrid, connid, currency

  


Data Preview

技术图片


SFLIGHT Table contents

技术图片

 

以上是关于ABAP CDS ON HANA-CDSビューでの集約的主要内容,如果未能解决你的问题,请参考以下文章

ABAP CDS ON HANA-ヘッダー行編集

ABAP on HANA之CDS Association和Path Expression

csharp ビューポート设定部分コード

新建cdsview时的几个注解说明

markdown コードレビューのベストプラクティス

csharp 选択したUIWidgetのプレビュー机能