SAP OData service的执行是如何从Gateway系统转交到backend系统
下面是我今天研究的后臺(tái)OData數(shù)據(jù)的model以及如何在IE里面consume:
SPRO里面:
這個(gè)model provider class定義了LWM_CUSTOMER_BRIEFING這個(gè)model的所有structure,以及structure之間的相互關(guān)系。
現(xiàn)在沒(méi)有一個(gè)圖形化界面的tool來(lái)做modelling,我們只能在CL_LWM_CB_ADAPTER_MDP的DEFINE里面定義model的structure。具體做法是預(yù)先定義好后臺(tái)要使用的entity的data type,
Customer briefing 所有使用到的DDIC object全部放在這個(gè)package里面:LWM_CRM_CUSTOMER_BRIEFING
在DEFINE里面,通過(guò)ABAP 代碼創(chuàng)建一個(gè)個(gè)entity,給它們綁上DDIC object,同時(shí)建立相互關(guān)系,如association.
通過(guò)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用這個(gè)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也能通過(guò)SICF進(jìn)去之后,從sap node出發(fā),點(diǎn)test拿到。
比如這部分就說(shuō)明CustomerCollection這個(gè)節(jié)點(diǎn)能夠執(zhí)行“search”的action:
然后我們?cè)贗E里面測(cè)試:
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里面實(shí)現(xiàn),
如果我們直接在IE里面通過(guò)http://ldcigm2.jerry.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/CustomerCollection(133)?sap-client=001&$format=xml
的URL consume OData service:
Gateway 系統(tǒng)上首先會(huì)根據(jù)OData service expose出來(lái)的external name找到internal使用的service ID:
然后根據(jù)service ID找到對(duì)應(yīng)的CRM 系統(tǒng)的destination:
通過(guò)RFC直接call CRM系統(tǒng)上的一個(gè)remote function module:
在CRM的這個(gè)FM上設(shè)個(gè)斷點(diǎn),發(fā)現(xiàn)斷點(diǎn)已經(jīng)被觸發(fā)了。
要獲取更多Jerry的原創(chuàng)文章,請(qǐng)關(guān)注公眾號(hào)"汪子熙":
總結(jié)
以上是生活随笔為你收集整理的SAP OData service的执行是如何从Gateway系统转交到backend系统的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ChatGPT刺激对芯片需求 全球AI芯
- 下一篇: SAP GUI和Windows注册表