Skip to Content

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.

/wp-content/uploads/2014/07/11_496187.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/Atomxmlns:m=http://schemas.microsoft.com/ado/2007/08/dataservices/metadataxmlns: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

To report this post you need to login first.

16 Comments

You must be Logged on to comment or reply to a post.

  1. spandana N

    Hi  Teja ,

      Nice Document .. keep it up .

    I have the same scenario .Followed the   above concept but getting error .  Please do needful .

    URL : /sap/opu/odata/sap/ZXXX_TEST_SRV;mo/Add_MatnrSet?$filter=SAP__Origin eq ‘LOCAL’ and IWerks eq ‘XX01’

    Error :

    <message xml:lang=”en>Internal error occurred, contact your system administrator.</message




    Thanks in advance

    Spandana

    (0) 
    1. Tejas Chouhan Post author

      Hi Spandana,

      Please confirm below points :

      1. Your architecture of the landscape is Embedded or Central Hub (GW and Backend in same system or separate)

      2. If Gw and backend is in different system and LOCAL is the system alias of your gateway system ? I guess you are trying here to get the data from your gw system. Where the data won’t exist.

      Scenario above explains getting data from 2 backend systems, using a gateway system.

      Regards,

      Tejas

      (0) 
      1. spandana N

        Hi Teja,

        SAP  GW and SAP Backend are two different systems  and  i have  2  system alias like KLD_400  local (another RFC connection ) .

        (0) 
  2. Duncan Aird

    Hi Tejas, I would like to know if I can use this on a SAP standard Fiori app, i.e. we don’t want to do any Z-development. We also don’t need to access multiple back-ends at the same time, only one at a time. But we want it to access the correct back-end depending on which tile was pressed. (Using authorizations works great if each employee must have access to one back-end only, but in our case we want one employee to be able to access each back-end according to his choice at the time)

    (0) 
    1. Tejas Chouhan Post author

      HI Duncan Aird

      Ideally it should work, Just say : you have 1 Gateway system and 3 backend system and 3 different apps.

      When user id : user01 logs in to launchpad and finds 3 applications.

      when he goes to 1st application, it should get data from 1st backend and respectively.

      You just have to enable Trusted RFC connection between gateway system and 3 ECC system.

      1st app -> System alias : SAP_ECC1

      2nd app -> System alias : SAP ECC2

      3rd app -> System alias : SAP ECC3

      In transaction : /iwfnd/maint_Service, you have to configure 1st app service’s system alias as SAP_ECC1, then it will show you the data from 1st backend.

      Role will be same for all the 3 apps. Only system alias will change.

      This will work. 🙂

      Regards,

      Tejas

      (0) 
    2. Deva L

      Hi Duncan,

      I have the same requirement. Were you able to achieve this for standard apps?. Depending on the tile press, the user should navigate to the corresponding client.

      thanks,

      Dev

      (0) 
      1. Michael Appleby

        Unless you are asking for clarification/correction of some part of the Document, please create a new Discussion marked as a Question.  The Comments section of a Blog (or Document) is not the right vehicle for asking questions as the results are not easily searchable.  Once your issue is solved, a Discussion with the solution (and marked with Correct Answer) makes the results visible to others experiencing a similar problem.  If a blog or document is related, put in a link.  Read the Getting Started documents (link at the top right) including the Rules of Engagement. 

        NOTE: Getting the link is easy enough for both the author and Blog.  Simply MouseOver the item, Right Click, and select Copy Shortcut.  Paste it into your Discussion.  You can also click on the url after pasting.  Click on the A to expand the options and select T (on the right) to Auto-Title the url.

        Thanks, Mike (Moderator)

        SAP Technology RIG

        (0) 
  3. Seshaiah Machavarapu

    Hi Tejas,

    Its very useful information. Thank you for sharing with us. I am also working on MOC support. Get_entity and Get_entityset are working fine with MOC. But Create_entity method is not working with MOC. It is giving an error message like “Inline component is not defined or not allowed (HTTP PUT)”. But when I remove “;mo” string from service URL, I am able to create the entity. Could you please help me in this??

    Thank You

    Seshu

    (0) 
      1. asish G

        Dear Tejas Chouhan ,

          i am new to ODATA.I created ODATA in development server of SAP Net weaver Gateway Hub system and accessing  RFC Remotley from other sap back end system. now i have to deploy my ODATA service to Quality server of SAP Net weaver Gateway Hub system.how can i register my service in Quality server.As i registered in developenment with my developement server details of Net weaver Gateway Hub system.

        so kindly look in to the same and revet me the same.

        thanks in advance.

        (0) 
    1. Michael Appleby

      Unless you are asking for clarification/correction of some part of the Document, please create a new Discussion marked as a Question.  The Comments section of a Blog (or Document) is not the right vehicle for asking questions as the results are not easily searchable.  Once your issue is solved, a Discussion with the solution (and marked with Correct Answer) makes the results visible to others experiencing a similar problem.  If a blog or document is related, put in a link.  Read the Getting Started documents (link at the top right) including the Rules of Engagement. 

      NOTE: Getting the link is easy enough for both the author and Blog.  Simply MouseOver the item, Right Click, and select Copy Shortcut.  Paste it into your Discussion.  You can also click on the url after pasting.  Click on the A to expand the options and select T (on the right) to Auto-Title the url.

      Thanks, Mike (Moderator)

      SAP Technology RIG

      (0) 

Leave a Reply