這篇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- 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
最後的效果:
本文來自雲栖社群合作夥伴“汪子熙”,了解相關資訊可以關注微信公衆号"汪子熙"。