下面是我今天研究的后台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/KaTeXparse error: Expected 'EOF', got '&' at position 24: …?sap-client=001&̲format=xml
service document也能通过SICF进去之后,从sap node出发,点test拿到。
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里面通过
的URL consume OData service:
Gateway 系统上首先会根据OData service expose出来的external name找到internal使用的service ID: