SAP云平台上两个ABAP系统实例之间的互连
場景:SAP云平臺上的兩個ABAP系統(tǒng)實例,一個作為數(shù)據(jù)的提供者-provision system;另一個作為數(shù)據(jù)的消費者 - client system,后者從前者讀取數(shù)據(jù),并顯示
實現(xiàn)步驟概述:
(1) client System創(chuàng)建outbound communication.
(2) 在provision系統(tǒng)創(chuàng)建inbound communication.
(3) Create a Service Consumption Model, and save this locally as a $metadata XML file; From this you will create proxy artefacts in the client system, representing the remote service, and use this model to generate an abstract entity.
(4) 創(chuàng)建一個remote client proxy
(5) 在client System創(chuàng)建一個OData服務(wù),使用Fiori Elements消費并展示從provision系統(tǒng)取回的數(shù)據(jù)
SAP標(biāo)準(zhǔn)發(fā)布的Communication Scenario SAP_COM_0276,提供了SAP Cloud Platform ABAP實例同遠(yuǎn)端的ABAP On-Premises系統(tǒng)或者第三方系統(tǒng)集成的可能性。
A communication arrangement specifies the metadata for a specific communication scenario, such as your host system and the authentication method. This metadata is contained in a service key. You can then define one or more specific destinations for this arrangement.
Communication Arrangement為Communication Scenario指定了必須的元數(shù)據(jù),包括通信系統(tǒng)和消息認(rèn)證方式等信息,這些元數(shù)據(jù)以Service key的形式存儲。可以基于Communication Arrangement創(chuàng)建Destination.
在SAP云平臺CloudFoundry環(huán)境里創(chuàng)建一個Destination服務(wù)實例:
基于這個Destination服務(wù)創(chuàng)建一個新的Destination實例:
url字段維護(hù)成provision System的url,確保連接能夠成功建立。
給Destination service創(chuàng)建一個新的service key,將其內(nèi)容保存在本地:
在client System上打開ABAP service instance的dashboard:
在Communication Arrangement tile里,創(chuàng)建一個新的實例:
從Communication Scenario下拉列表里,選擇之前介紹的SAP_COM_0276: SAP CP CF Destination Service integration:
選擇好Communication Scenario后,維護(hù)Communication Arrangement的名稱,比如OUTBOUND_XXX.
在Communication Arrangement的additional properties里,將service instance name的值從默認(rèn)值OUTBOUND_XXX改成更便于記憶的值,比如Outbound-For-Tutorials_XXX.
最后一步,在ABAP client System上創(chuàng)建ABAP 實現(xiàn)類:
CLASS ZCL_OUTPUT_HTTP_XXX DEFINITIONPUBLICFINALCREATE PUBLIC .PUBLIC SECTION.INTERFACES if_oo_adt_classrun.PROTECTED SECTION.PRIVATE SECTION. ENDCLASS.CLASS ZCL_OUTPUT_HTTP_XXX IMPLEMENTATION.METHOD if_oo_adt_classrun~main.TRY.DATA(lo_destination) = cl_http_destination_provider=>create_by_cloud_destination(i_name = 'A4C_ACCESS_XXX_HTTP'i_service_instance_name = 'Outbound-For-Tutorial-XXX'i_authn_mode = if_a4c_cp_service=>service_specific ).DATA(lo_http_client) = cl_web_http_client_manager=>create_by_http_destination( i_destination = lo_destination ).DATA(lo_request) = lo_http_client->get_http_request( ).DATA(lo_response) = lo_http_client->execute( i_method = if_web_http_client=>get ).out->write( lo_response->get_text( ) ).CATCH cx_root INTO DATA(lx_exception).out->write( lx_exception->get_text( ) ).ENDTRY.ENDMETHOD.ENDCLASS.第18行的參數(shù)i_name的值,就是之前在SAP Cloud Platform里創(chuàng)建的Destination名稱。
i_service_instance_name, 就是創(chuàng)建的Communication Arrangement additional properties里創(chuàng)建的Service instance name的值。
執(zhí)行ABAP類,測試結(jié)果如下:
要獲取更多Jerry的原創(chuàng)文章,請關(guān)注公眾號"汪子熙":
總結(jié)
以上是生活随笔為你收集整理的SAP云平台上两个ABAP系统实例之间的互连的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阴阳师纸舞好用吗?纸舞技能一览
- 下一篇: 如何导入某网站的certificate证