S/4HANA key user tool extensibility 的工作原理

举报
Jerry Wang 发表于 2022/02/18 21:38:35 2022/02/18
【摘要】 Reasons of different behavior in “UI and Reports” list问题就是不同的系统这个 UIs and Reports 里的显示逻辑不一样。 在 GRE210 连 XT9/715 上,里面只会显示 OData 出来,我 debug 了前后台, 后台返回的 Usage 数据里,说明这个做在 business context PRODUCT 上的 e...

Reasons of different behavior in “UI and Reports” list

问题就是不同的系统这个 UIs and Reports 里的显示逻辑不一样。 在 GRE210 连 XT9/715 上,里面只会显示 OData 出来,我 debug 了前后台, 后台返回的 Usage 数据里,说明这个做在 business context PRODUCT 上的 extension field 能加在 view I_PRODUCTWD 上,因为其 AvailablityCode 是 Y

而我所有和 CDS 相关的 usageTypeCode 都是-,所以全部被 filter 掉了。 再看另一个系统 QJ3/500,这里能显示出所有的 field usage,不仅仅是 U 的。 这个 QJ3/500 是 sandbox 系统,今天挂了,我也没办法进去看代码,我就 想问问到底哪个才是 working as designed 的 behavior

In system A, you can only get 5 entries in UI and Reports list:

In system B, there are much more entries:

how to debug this difference:搞懂了哈, 从代码推断只有这里 UI,Report 里为 X 的 CDS view 才会出现在 Fiori UI 的 tab 里。在 XT9/715( S4 on premise )所有和 product 相关的 CDS view 都是 false,所以看不到。而另外一个 S4 on cloud 系统里,和 product 相关的 CDS view 都是 true。 所以结论是两个系统的 behavior 都是正确的,只是因为 reigstry 里设置 不一样,所以最后在 UI list 里显示的东西也不一样。

系统1:

系统2:

最近研究了后台OData数据的model以及如何在IE里面consume:

SPRO里面:

这个model provider class定义了LWM_CUSTOMER_BRIEFING这个model的所有structure,以及structure之间的相互关系。
现在没有一个图形化界面的tool来做modelling,我们只能在CL_LWM_CB_ADAPTER_MDP的DEFINE里面定义model的structure。具体做法是预先定义好后台要使用的entity的data type,
Customer briefing 所有使用到的DDIC object全部放在这个package里面:LWM_CRM_CUSTOMER_BRIEFING

在DEFINE里面,通过ABAP 代码创建一个个entity,给它们绑上DDIC object,同时建立相互关系,如association.


通过http://diablo.herr.corp:50018/sap/opu/sdata/sap/customer_briefing?sap-client=001 我们可以拿到customer briefing的service document。
Service document里面只定义了哪些entity暴露了哪些操作,真正metadata的full definition xml用这个URL down:
http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/customer_briefing/metadata?sap-client=001&format=xml

service document也能通过SICF进去之后,从sap node出发,点test拿到。

比如这部分就说明CustomerCollection这个节点能够执行“search”的action:

然后我们在IE里面测试:
http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/CustomerCollection?sap-client=001&$format=xml&search

返回所有的Customer信息,Customer node的property就是在figure1里面看到的那些。

Search 所有name property中包含“UT_Customer” 的Customer
http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/CustomerCollection?sap-client=001&$format=xml&search=UT_Customer

返回Partner ID = 133的customer的detail 信息
http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/CustomerCollection(133)?sap-client=001&$format=xml

所有这些操作都在service provider class CL_LWM_CB_ADAPTER_RDP里面实现,

如果我们直接在IE里面通过http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/CustomerCollection(133)?sap-client=001&$format=xml
的URL consume OData service:

Gateway 系统上首先会根据OData service expose出来的external name找到internal使用的service ID:

然后根据service ID找到对应的CRM 系统的destination:

通过RFC直接call CRM系统上的一个remote function module:


在CRM的这个FM上设个断点,发现断点已经被触发了。

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。