众所周知,我们可以利用cds view创建数据源,并在cds view里创建特定字段,用来做增量,或者是简单的计算,格式转换等,
例如当表里没有支持delta的时间戳时,我们可以利用日期跟时间在cds view里合成时间戳用来支持delta,实现方法如下:
@AbapCatalog.sqlViewName: 'ZCDSRSPC0001'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Process Chain log'
@Analytics: { dataCategory: #FACT,
dataExtraction: { enabled :true,
delta.byElement.name : 'lastChangedAt',
delta.byElement.maxDelayInSeconds : '100',
delta.byElement.detectDeletedRecords: true }}
define view ZCDS_RSPC_0001 as select from rspclogchain{
key rspclogchain.chain_id,
key rspclogchain.log_id,
rspclogchain.datum,
@Semantics.systemDate.lastChangedAt: true
--concat(rspclogchain.datum,rspclogchain.zeit) as lastChangedAt
cast ( dats_tims_to_tstmp ( datum,
zeit