这篇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/
![webp](https://i-blog.csdnimg.cn/blog_migrate/09cb5b17082a6a48d18761b25ebeb288.webp?x-image-process=image/format,png)
主要是这两张表:
CUAND_CE_IC_ROOT
CUAND_CE_IC_FCET
现在我的需求是:对系统里Contact的Origin Data数据来源渠道个数从高到低的顺序进行排序:
![webp](https://i-blog.csdnimg.cn/blog_migrate/f66db94a94533aeaf999c1a8ff2a4d8a.webp?x-image-process=image/format,png)
解决方案:开发两个CDS view
- 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
}
- 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
最后的效果:
![webp](https://i-blog.csdnimg.cn/blog_migrate/716344949e2df89afaa6d68736ff86b2.webp?x-image-process=image/format,png)
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
![webp](https://i-blog.csdnimg.cn/blog_migrate/96a96883d676e8abbd452718e08f90ed.webp?x-image-process=image/format,png)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24475491/viewspace-2649478/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24475491/viewspace-2649478/