SAP OData service的执行是如何从Gateway系统转交到backend系统
下面是我今天研究的后臺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/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的原創文章,請關注公眾號"汪子熙":
 
總結
以上是生活随笔為你收集整理的SAP OData service的执行是如何从Gateway系统转交到backend系统的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: ChatGPT刺激对芯片需求 全球AI芯
- 下一篇: 训练效果未及预期,31 名 ChatGP
