Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1315368
  • 博文数量: 932
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 10208
  • 用 户 组: 普通用户
  • 注册时间: 2011-07-08 12:28
文章分类

全部博文(932)

文章存档

2021年(1)

2020年(134)

2019年(792)

2018年(5)

我的朋友

分类: 架构设计与优化

2019-07-04 22:26:03

这篇SAP社区博客里,我的一位同事介绍了SAP Marketing里contact facet数据模型的存储表:
https://blogs.sap.com/2016/07/01/how-does-sap-hybris-marketing-build-the-golden-record-of-an-interaction-contact/

主要是这两张表:

CUAND_CE_IC_ROOT

CUAND_CE_IC_FCET

现在我的需求是:对系统里Contact的Origin Data数据来源渠道个数从高到低的顺序进行排序:

解决方案:开发两个CDS view

  1. zcontact_origin
@AbapCatalog.sqlViewName: 'SQL_VIEW_NAME'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Contact Origin tool' define view zcontact_origin as select from cuand_ce_ic_root as a inner join cuand_ce_ic_fcet as b on a.db_key = b.parent_key  { key a.db_key,
   a.name_text,
   a.smtp_addr,
   b.db_key as children_key,
   b.id_origin
} 
  1. zcontact_count
@AbapCatalog.sqlViewName: 'ZCONCOUNT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'count aggregation' define view ZCONTACT_COUNT as select from zcontact_origin { key zcontact_origin.db_key,
   zcontact_origin.smtp_addr, count(*) as facet_count
} group by db_key, smtp_addr 

最后的效果:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":


阅读(1666) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~