Quantcast
Channel: SCN : All Content - SAP for Mobile
Viewing all articles
Browse latest Browse all 6147

Getting Data from 2 ERP systems using Multi Origin

$
0
0

Take a scenario where you need to create a service where we need to fetch data from multiple backend system.


We will just see the high level design for fulfilling this requirement :


Prerequisite :


  1. Gateway System is connected to all the back end system from which the data is to be fetched.
  2. System alias for all the back end system is maintained
  3. Parallelization node is maintained for better performance : Open the SAP Reference IMG in transaction SPRO and navigate to  SAP NetWeaver Gateway OData Channel Administration General Settings Define Parallelization for Multiple Origin Composition .


Say :

     GWS : Gateway System

     SAP_ERP1 : Backend system alias 1

     SAP_ERP 2 : Backend system alias 2

 

  • To define a service with multiorigin, we use ;mo with the service name . For eg : sap/opu/odata/sap/ZSERVICE;mo/$metadata
  • With the addition of ;mo, a new key property "SAP__Origin" is added in the response
  • SAP_Origin will specify the system alias to be used to get the data from different ERP systems.

 

11.png

 

Creation of Service :

 

  1. First we need to create a Gateway service using RFC or Structure.
  2. For using RFC we make sure that same RFC is present in all the ERP systems, with Import and Export parameters and the same Structure should be available in all the ERP systems, with the ABAP fields being the same.
  3. Create a GW project on all the backend system with same name : say ZSERVICE
  4. Once the service is created, add one of the service using one of the system alias say SAP_ERP1
  5. You dont need to add all the service as the names are same. Only one should do.
  6. Now you need to add all the system alias in /IWFND/MAINT_SERVICE for the ZSERVICE
  7. SAP_ERP1, SAP_ERP2, SAP_ERP3....etc

 

Execution from Gateway Client alternatively : Gateway client (/iwfnd/gw_client) :

 

You can execute GET, PUT, POST operations to read, update , create data.

 

Get_Entity can be used as :

  • /sap/opu/odata/sap/ZTEST_SRV;mo/GetBankDetailsSet(SAP_Origin=’ECC1’,Bankcountry=’’,Bankkey=’0001’)

 

Get_EntitySet can be used as :

  • /sap/opu/odata/sap/ZTEST_SRV;mo/GetBankDetailsSet?$filter=SAP_Origin eq ‘SAP_ERP1’ and Bankkey eq ‘0001’ and Bankcountry eq ‘Country’
  • /sap/opu/odata/sap/ZTEST_SRV;mo/GetBankDetailsSet?$filter=SAP_Origin eq ‘SAP_ERP2’ and Bankkey eq ‘0004’ and Bankcountry eq ‘Country’

 

POST :

 

/sap/opu/odata/sap/ZTEST_SRV;mo/CreateBankNo


XML :


<?xml version="1.0" encoding="utf-8"?>
<entry xml:base=
"http://mytestdomain.com/sap/opu/odata/sap/ZSERVICE_SRV/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<category term=
"ZSERVICE_SRV/CreateBankNo" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type=
"application/xml">
<m:properties>
<d:SAP__Origin>SAP_ERP1</d:SAP__Origin>
<d:BankData>Test</d:BankData>
<d:BankArea>TestArea</d:BankArea>
<d:BankCode>00001</d:BankCode>
</m:properties>
</content>
</entry>

 

Let me know if this article is useful for custom Fiori like application and to get the details from different systems. :

 

Thanks. Appreciate your responses

 

Cheers!!

Tejas


Viewing all articles
Browse latest Browse all 6147

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>