How to perform SAP OData service is transmitted from the Gateway system to the backend system

Here is my today's model of the background research and how to consume OData data in IE:

SPRO inside:

This model provider class defines all of the structure LWM_CUSTOMER_BRIEFING this model, as well as the relationship between the structure.
Now is not a graphical interface tool to do modelling, we can only define the structure model in CL_LWM_CB_ADAPTER_MDP the DEFINE inside. The specific approach is to use pre-defined background of the type of entity in the Data,
the Customer Briefing all use of DDIC object to all on this package inside: LWM_CRM_CUSTOMER_BRIEFING

In DEFINE inside, ABAP code created by one entity, they are tied to the DDIC object, while building the relationship, such as association.


通过http://ldcigm2.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/KaTeX parse error: Expected 'EOF', got '&' at position 24: …?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上设个断点,发现断点已经被触发了。

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

发布了6389 篇原创文章 · 获赞 621 · 访问量 101万+

Guess you like

Origin blog.csdn.net/i042416/article/details/104056528