SAP ODATA GATEWAY SERVICE

Hi experts
I want to create odata service to read individual and corporate account, for this I have created one remote enabled FM but where i used import parameter an Partner number and in export i hav created custom structure with multiple fields and again structure. But in service builder it showing error 'deep structure is not allowd' how can i resolve this error.

Hello Faseeh,
As per the screen shot its a nested structure.
I would suggest the below way of implementation as per best of my understanding :
For an instance lets assume you are sending Business_Partner Number say 10000 as input to get all the details of that particular Business_Partner which u have shared in the screen shot.
1. Create Parent Entity say BP_NUM which has the input Business_Partner Number.
2. Create Child Entity say BP_DETAIL which has got all the fields apart from PHONE , FAX & EMAIL tables.
3. Create Child Entity say PH_DETAIL which has got all the fields related for PHONE details of BP only.
4. Create Child Entity say FAX_DETAIL which has got all the fields related for FAX details of BP only .
5. Create Child Entity say EMAIL_DETAIL which has got all the fields related for EMAIL details of BP only.
Now Create Association and Navigation as follows :
BP_NUM to BP_DETAIL - 1 to 1
( assuming response of your FM will have one business partner as output and corresponding details for FAX, PHONE & EMAIL tables )
BP_NUM to PH_DETAIL - 1 to N
BP_NUM to FAX_DETAIL - 1 to N
BP_NUM to EMAIL_DETAIL - 1 to N
Implement Expand_Entity and pass BP Number as key ( assuming your FM will take a particular BP Number and returns all the details which u have shared in the screen shot ).
Refer the below for technical details.
Implementing Expand Entity/Entity Set
Create a deep structure and as a response return the corresponding tables accordingly by sending back navigation properties correctly to the expand clause.
Regards,
Ashwin

Similar Messages

  • ODATA Gateway Service

    Hello Expert,
    I want to create Odata gateway service to READ Account detail with multiple importing parameter along with value range for that parameter for RFC/BOR object. How I will achieve this object please let me know.Its urgent.
    Thank's

    Hello,
    Since u would like to pass range values to those key parameters, there would be single/multiple or null entries as part of GW response based on your input value. Considering that the method which is to be implemented is Get_Entity_Set/QUERY operation.
    READ operation can hold one 1 entry as part of GW response when u implement Get_Entity / READ operation.
    To perform a READ operation u need to implement Get_Entity method.
    READ operation needs KEY's to be passed.
    Response can have a single entry as part of response or null.
    To perform a QUERY operation u need to implement Get_Entity_Set method.
    QUERY operation needs FILTER's to be passed.
    Response can have either single/multiple entries or null as part of response.
    So decide what exactly u need to implement based on your use case Get_Entity/READ or Get_Entity_Set/QUERY operation.
    However the steps are same as below.
    1. Implement based on your requirement.
    a. Get_Entity_Set / QUERY operation and map the fields accordingly in Service Builder and generate run-time objects.
    OR
    a. Get_Entity/ READ operation and map the fields accordingly in Service Builder and generate run-time objects.
    2. In DPC_EXT class , Redefine below methods and just write ' EXIT ' and activate.
    /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN
    /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END
    3. As per my knowledge the below are the operators supported by GW through URL.
    EQ Equals
    LE Less than or equal to
    GE Greater than or equal to
    NE Not equal to
    GT Greater than
    LT Less than
    Other operators like CP etc... has to be handled explicitly in GW level in DPC_EXT class in respective methods by checking whether the input value contains ' * ' .
    If the input contains ' * ' then u need to pass CP operator explicitly in the code level.
    4. U need to Create a PAYLOAD to BATCH all the different operations in a single request :
    Headers to be passed :
    Content-Type :  multipart/mixed; boundary=batch
    x-csrf-token : < pass the value >
    Method :
    POST
    Sample URL :
    http://<Host with the Port Num>/sap/opu/odata/sap/<Your Service Name>/$batch
    Sample Payload -> example when u have two operations in 1 single request.
    If Get_Entity / READ is implemented then below is the PAYLOAD :
    --batch
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    GET get_data11(ImWhttype='C2',ImCountry='TH') HTTP/1.1
    --batch
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    GET get_data11(ImWhttype='C1',ImCountry='TH') HTTP/1.1
    --batch--
    If Get_Entity_Set / QUERY is implemented then below is the PAYLOAD :
    --batch
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    GET get_rec_types1?$format=json HTTP/1.1
    --batch
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    GET get_order_details HTTP/1.1
    --batch--
    With this u must be able to implement what u r expecting.
    Revert if any issues.
    Regards,
    Ashwin

  • SAP NW Gateway Development Aspects

    Hi,
      I have just started with SAP NW Gateway and in a learning stage.
      I have some questions on the SAP NW Gateway development aspects.
      1. Whether we need to develop the services in the backend (SAP ECC - SEGW transactions) and need to only expose the NW Gateway system or we need to develop the business logic in backend (SAP ECC) and need to develop the interfacing components (NW Gateway - SEGW)?
      2. Are there any development guidelines (preferrably published by SAP)?
      Anticipating your response.
    - Vipin

    Hi,
    it is based on how your system architecture looks like.
    refer blog  SAP Gateway deployment options in a nutshell to know more on hub and embedded architecture.
    also refer SAP NetWeaver Gateway Foundation Developer Guide - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
    SAP NetWeaver Gateway Service Builder - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
    This will clear your questions.
    Regards,
    Chandra

  • SAP.m JS/XML and Gateway service

    Hello
    I've been trying to consume a gateway service with the sap.m classes.
    it turned out quite difficult for me as im new in this whole web thing, and most of the examples for sap.m are in XML.
    i've tried to convert some of the examples in sap.common to sap.m but couldnt really figure it out.
    my XML project returns the error:FlightsSet' refers to an entity set and not to a single entity
    flightset is an entity in my gateway service.
    my oninit function looks like this:
    onInit: function() {
      var oModel = new sap.ui.model.odata.ODataModel("proxy/http/serveradress:8000/sap/opu/odata/sap/ZS_ELI_FLIGHT_PROJECT_SRV", false, 'user', 'pass', null);
        this.getView().setModel(oModel);
    the xml:
    <mvc:View
      controllerName="flightproject.TableView"
      xmlns:l="sap.ui.layout"
      xmlns:mvc="sap.ui.core.mvc"
      xmlns="sap.m">
      <Table id="idProductsTable"
        inset="false"
        items="{
          path: '/FlightsSet'
        }">
        <headerToolbar>
          <Toolbar>
            <Label text="Products"></Label>
          </Toolbar>
        </headerToolbar>
        <columns>
          <Column
            width="12em">
            <Label text="Flight company" />
          </Column>
          <Column
            minScreenWidth="Tablet"
            demandPopin="true">
            <Label text="Flight ID" />
          </Column>
        </columns>
        <items>
          <ColumnListItem>
            <cells>
              <ObjectIdentifier
                title="{Connid}"
                text="{Carrid}" />
              <Text
                text="{CITYFROM}" />
            </cells>
          </ColumnListItem>
        </items>
      </Table>
    </mvc:View>
    am i doing something wrong? thanks

    Hi Lavanya,
    If you are planning to use the TCP/IP destination on the SAP system in Register mode, then a siebel application has to register at the sap gateway using the <b>Program ID</b> given in the TCP/IP destination on the SAP system.
    In the TCP/IP destination the gateway options should contain the gateway host of the sap system and the gateway service. usually the gateway host is the message server itself and the gateway service is "sapgwXX", where XX is the <system_number>.
    Thanks,
    Renjith.

  • How to build an OData Service with Gateway Service Builder (NO DDIC, BOR import)

    Hi Community,
    I hope to get an answer here to finish my project. I´m a newbie to the sap gateway service builder. Please provide me a helping hand.
    I have a problem I´m sure someone out there can help me.
    I need to create an sap ui app, which is monitoring our database behaviour (->transaction st06) is there someone who knows how to build a OData Channel with sap gateway service builder without importing a BOR- Object, or a DDIC?
    Or how to build an OData channel which exposes the database (monitoring) data from ST06?
    I would really appreciate if someone could help me.
    THANKS!
    JOE

    Hello Joe,
    If u do not want to import any Structure or BOR- Object, u can follow below steps :
    1. Create ur data model by adding the properties manually in SAP GW service builder with correct Edm    types.Doing this would be pain in my opinion ( sometimes we are forced to do this but no other option    doing this way )
       Create associations & navigation needed. 
    2. U can generate run-time objects.
    3. Go to appropriate classes and implement methods with ur Business Logic.
    4. Register ur service & consume.
    U can also import RFC to create data model and create mapping as per required by implementing correct method as well.
    once u do this generate objects and register service and consume it.
    Check this out for ur info :
    Detailed step by step procedure for Creating Gateway Service with all the CRUD Operations and testing them in Service Explorer Part1 
    Regards,
    Ashwin

  • How to Upload documents using Gateway Service in SAP UI5?

    Hi Team,
    How to upload documents using Gateway Service in UI5 app.
    This is Attachment Functionality.using Gateway Service in Controller.JS/View.JS.
    Thanks in Advance.
    Regards,
    Satya

    Hi,
    I suggest you use the search function on scn/google...
    Anyways, here are some usefull links:
    How To Upload and Download Files Using SAP NW Gateway SP06
    Uploading files to SAP using HTML5 /AJAX/Gateway media links with real-time progress bar
    Kind regards,
    RW

  • How to find the Values of SAP Gateway Server Host  and Gateway Service Valu

    Hi All,
    I installed SAPR/3 4.7 EE on Windows. For configuring SLD and LDAP i am unable to give the SAP Gateway Server Host and Gateway Service values.
    Can any one plz suggest me how to find these values.
    Regds
    Phanikumar

    Hello, SAP Gateway Server Host and Gateway Service are used to set up rfc connectivity, that is the host name and the system number where your sld and ldap is responding, if you have no sld and no ldap , just simply uncheck that options while installing.
    Have a nice week end, Luciano.

  • Create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse

    Hi,
    I followed the amazing SAPUI5 blog :
    How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse
    I was able to resolve all errors mentioned in this blog but then i get another error :
    Uncaught TypeError: Cannot read property 'dataServices' of undefined
    Any idea what is the problem.
    Thanks a lot!
    Amina

    Hi,
    I followed the amazing SAPUI5 blog :
    How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse
    I was able to resolve all errors mentioned in this blog but then i get another error :
    Uncaught TypeError: Cannot read property 'dataServices' of undefined
    Any idea what is the problem.
    Thanks a lot!
    Amina

  • SAP Netweaver Gateway 2.0 vs. Web Services

    Hello,
    I want to ask about SAP Netweaver Gateway 2.0. I understand its usage but why do we need it when we can create (globally compatible) web services and use SOa Manager? I want to implement Gateway add-on but I need to know differences between web services and Gateway before making last decision.
    Thank you.

    Hi,
    I have just answered your question in the the Gateway Forum...
    Martin

  • Connect to SAP Cluster Gateway failed

    Hi all,
    We have outbound idoc from SAP clusters for further configuration.
    We have java applications deployed in IBM WebSphere Application Cluster (WAS_A and WAS_B)
    At SAP side, we have 2 SAP instance, CI and DI with ACSC configuration,
    For the gateway ports,
    1. 3336 for CI
    2. 3326 for DI
    3. 3316 for ASCS
    For outbound idoc, RFC is created to pointing at host and gateway. (ASCS and 3316)
    We encountered the following errors
    Connection parameters: TYPE=B DEST=SRP.644195 MSHOST=PSRPSVC GROUP=SPACE R3NAME=SRP PCS=1 COMM_CP=1100
    LOCATION    CPIC (TCP/IP) on local host swfp04 with Unicode
    ERROR       internal error
    TIME        Wed Apr  6 19:41:14 2011
    RELEASE     720
    COMPONENT   MS (message handling interface, multithreaded)
    VERSION     4
    RC          -101
    COUNTER     5
    [4/6/11 19:42:25:104 CST] 0000002b SAPRAResource I com.ibm.j2ca.sap.SAPResourceAdapter endpointActivation(MessageEndpointFactory,ActivationSpec):  com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed
    Connection parameters: TYPE=B DEST=SRP.747574 MSHOST=PSRPSVC GROUP=SPACE R3NAME=SRP PCS=1 COMM_CP=1100
    LOCATION    CPIC (TCP/IP) on local host swfp05 with Unicode
    ERROR       internal error
    TIME        Wed Apr  6 19:42:25 2011
    RELEASE     720
    COMPONENT   MS (message handling interface, multithreaded)
    VERSION     4
    RC          -101
    COUNTER     5
    If we set RFC pointing at either DI or CI only, it works.  However, it does not work for ASCS.
    Please help what else we are missing or any notes can be referred.

    Hi DinyBee,
    I am assume you have an URL that can get response from your OData Channel Gateway Service. You can test this in your browser. The URL should be something like this: http://gateway.company.com:8000/sap/opu/sdata/sap/APPLICATION/XXXCollection?sap-client=100&$format=xml
    If the URL is working, you can setup an Application Connection in your SCC by follow the steps:
    1. Select Applications, then go to Application Connection tab
    2. Register a new User, with all the correct Server information, remember specify your activation code.
    3. After you register the user, at the same Application Connection tab, select your user, and click Properties.
    4. Go to Proxy option, and you insert the URL "http://gateway.company.com:8000/sap/opu/sdata/sap/APPLICATION/" into the Application Endpoint. Then click OK.
    5. In your iOS application code, you register your Application using the object LiteSUPUserManager, and then get the Application Endpoint by using object LiteSUPAppSetting.
    6. Now, your application already got Online in the SUP, and the application also know which URL it should connect to.
    7. From now on, you can use object SDMRequestBuilder to build the request, and get the response from the OData Gateway.
    This is just a high level steps for you to reference, you should refer to Sybase documentation to get more information about the objects that I mentioned.
    Thank you.
    Regards,
    Edison Wang

  • Getting 'access is denied' error when access Flight Example sample gateway service

    Hi All, Greetings! I am new to SAPUI5. I am getting 'Access is denied' when trying to load data from the sample gateway service (Flight Example). Please help.
    Here's the entire code:
    view1.view.js
    sap.ui.jsview("ui5_proj09_flightdemo.view1", {
          getControllerName : function() {
             return "ui5_proj09_flightdemo.view1";
          createContent : function(oController) {
         var serviceURL = "https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/";
         var readRequestURL = "/FlightCollection(carrid='AA',connid='0017',fldate=datetime'2013-05-01T00:00:00')/?$format=xml";
           var loginoDataModel = new sap.ui.model.odata.ODataModel(serviceURL, true, "my_sapes1_userid", "my_sapes1_pwd");
           alert("Before Service Call");
           loginoDataModel.read(readRequestURL, null, null, false, 
                       function(oData, oResponse) {
                      alert("Success");
                             var result = oData.results;
                             alert(result.length);
                             if(result.length > 0){
                                 webmodel.setData({modelData: result});
                                 table.bindRows("/modelData");
                       function(oError){
                             alert("Error::"+oError.message); //getting 'access is denied' error message popup at this line
           alert("After Service Call");
              var oTable = new sap.ui.table.Table( {
      id : "oTableid", // sap.ui.core.ID
      width : "auto", // sap.ui.core.CSSSize
      rowHeight : undefined, // int
      columnHeaderHeight : undefined, // int
      columnHeaderVisible : true, // boolean
      visibleRowCount : 10, // int
      firstVisibleRow : 0, // int
      selectionMode : sap.ui.table.SelectionMode.Single // sap.ui.table.SelectionMode
      //Define the columns and the control templates to be used
      var oColumn = new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "City From"}),
      template: new sap.ui.commons.TextField().bindValue("cityFrom"),
      sortProperty: "lastName",
      filterProperty: "lastName",
      width: "200px"
      oTable.addColumn(oColumn);
      var oColumn2 = new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "City To"}),
      template: new sap.ui.commons.TextView().bindProperty("text", "cityTo"),
      sortProperty: "firstName",
      filterProperty: "firstName",
      width: "200px"
      oTable.addColumn(oColumn2);
    // oTable.bindRows("/modelData");
      oTable.placeAt("content");
    index.html
    <!DOCTYPE HTML>
    <html>
           <head>
                  <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <script src="resources/sap-ui-core.js"
                          id="sap-ui-bootstrap"
                          data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.ui.core"
                          data-sap-ui-theme="sap_goldreflection" >
                  </script>
                  <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
         <script>
              sap.ui.localResources("ui5_proj09_flightdemo");
                         var view = sap.ui.view({id:"idview11", viewName:"ui5_proj09_flightdemo.view1", type:sap.ui.core.mvc.ViewType.JS});
                view.placeAt("content");
         </script>
           </head>
           <body class="sapUiBody" role="application">
                  <div id="content"></div>
           </body>
    </html>
    Regards,
    Sai

    Hi Sai,
    You can refer my blog How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse
    Please go though it and see if it helps you to resolve this issue.
    Regards,
    Chandra

  • Difference between SAP NetWeaver Gateway 2.0 and SAP NetWeaver Gateway productivity accelerator for Microsoft

    Hi Experts ,
    Can anyone tell me the difference between SAP NetWeaver Gateway 2.0 and SAP NetWeaver Gateway productivity accelerator for Microsoft ?
    Best Regards,
    SK

    SAP  Netweaver Gateway 2.0 is a product for Exposing ERP data as OData for external consumption which is independent of any Microsoft product. Using this you can model OData services and Expose them for light weight consumption. You can use this in use cases where  you just want to consume the OData in some client or so, and you do not want any kind of accelerators to help you in development or in your integration.
    GWPAM is an interoperability framework from SAP that leverages SAP NetWeaver Gateway and Microsoft technologies enabling customers and partners to easily and quickly compose solutions that consume and extend SAP throughout Microsoft technologies for on premise and on demand deployment. With GWPAM you get components like
    GWPAM Visual Studio Add-On,GWPAM Template,GWPAM Project,GWPAM Outlook Add-In which are very much Microsoft specific.

  • How to create a working  Gateway service utilizing an Existing ECC Function Module?

    Hello All,
    Our ECC (Back end) has a Function module which is to be used by creating a Gateway service .Can you suggest the step by step procedure with which i can continue to expose the service?
    Any help on this is much appreciated!
    Thanks,
    Usha

    Hi Usha,
    the flag 'Local app' indicates where the implementation of the service is done because it can be done on the Hub or on the backend. (see my blog about deployment options SAP Gateway deployment options in a nutshell).
    If you choose 'Local App' the BEP API will be called on your hub while otherwise it will be called on the backend system to which the RFC destination points to which has been maintained in your system alias definition.
    Best Regards,
    Andre
    This is explanation offered by SAP Help:
    Indicates that the System Alias is to be used by BEP
    SAP NetWeaver Gateway applications can be developed either on a SAP Business
    Suite backend system or on a SAP NetWeaver Gateway hub system. To access the
    business logic from an SAP Business Suite backend system the software component
    IW_BEP (Backend Enablement and Event Provisioning) has to be deployed in your
    system landscape. IW_BEP can be deployed on the backend system or locally on the
    SAP NetWeaver Gateway hub system. Communication is handled via system aliases
    (RFC destinations).
    Use
    Set this flag if you use this system alias for an OData Channel application
    that has been developed on the BEP add-on which is deployed on the SAP NetWeaver
    Gateway hub system.
    In this case the system alias information (such as RFC destiation, Web
    service group, software version) is not used by SAP NetWeaver Gateway to
    call the BEP API (it is called locally). Instead the system alias information is
    passed through to the OData Channel application, so that it could then itself
    make a call to the corresponding backend system.

  • Gateway Service Create with Multiple Line Items

    Hello,
    I observed that you can create an entity in gateway with only a Flat structure, no nested structure or a structure with an internal table is not supported. As i have a requirement of creating a purchase order with multiple items through a create call in gateway service.how do i achieve this.Can any one provide me some direction.
    regards
    Kaushik

    Kaushik,
    In your case Purchase Order header will be an Entity and Purchase Order Line item another entity. You define relationship between them using Associations and Referential Constraints.
    For fetching both at a time, you need to use a '$expand'. For creating both at a time, you use 'Deep Insert'.
    I would suggest you to go through odata.org and search these concepts.
    Also you can read more here.
    Similar Discussion.
    Data model design, Do I need a complex entity?
    About deep Insert
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d92637-3d0d-2f10-ebb2-efc1f40a85e8?QuickLink=index&…
    About $expand
    Basic and Generic Expand - SAP NetWeaver Gateway - SAP Library

  • Gateway service with multiple entity sets

    Hi,
    I have designed a Gateway service with 3 entities, and 3 entity sets.Entity sets are not related one to another. This entity sets correspond to static data stored in 3 different custom table in SAP. The aim of this service is to provide static data (but customizable on the backend) for drop down lists on a SAP UI5 application consuming Gateway services.
    I am wondering if it is possible through a single read operation, to retrieve all entity sets. Since the service URL to get data related to one entity set is /sap/opu/odata/sap/ZTEST_SERVICE_SRV/EntitySet, how should I process if I want to retrieve all 3 entity sets ? Is it something possible or do we have to call each entity set at once ?
    Thanks in advance for your help.
    Thibault

    Hi Krishna,
    I'd try and avoid a construct like this because I don't think it's very compliant or discoverable - you have to know how to access it. That's maybe acceptable for "internal" services, but really, we should try and use the protocol instead of introducing so many workarounds.
    It seems that the simplicity of OData on some levels makes people think they have got the wrong answer. It can get complex but something like a value list is pretty basic and shouldn't be subject to loads of different interpretations.   
    Batching GET's on the entities or using a grouping entity as per Andre's suggestion is what I'd be thinking of doing. I know that the former is used by some Fiori applications.
    Regards
    Ron.

Maybe you are looking for

  • ICal custom colors?

    I know that recently users have been having issues with iCloud not saving calendar colors. I had this too, but that seems to be fixed. The problem is that it fixed itself in iCloud, but the custom colors don't come through to my iPhone or iPad. I've

  • How do I convert a file located in my e-mail from PDF to Word.  I can't seem to save it in my word files.

    How do I convert a file located in my e-mail (that is secured) from PDF to Word.  I can't seem to save the PDF file anywhere.

  • I can't use my Safari app at all..

    I hope someone can help! I posted on one of the other boards without success... I can't use my Safari app at all. Every time I try to open it, the app I used (and closed) previously opens instead. It doesn't matter what app it is, it is just the prev

  • Sprint/CDMA iPhone 4 into iPod touch?

    I have a Sprint (CDMA) iPhone 4 that is due to be deactivated on 2/26. Ive already erased all my data, removed it from my iTunes account, turned off iMessaging etc. to get ready for resale but maybe I'll just keep it as an iPod Touch.. Each of the wa

  • Required Quantity are not copy from BOM

    Dear SAP GURU, I encounter this situation when i try Convert Plan Order ---> PO , Or Try create Process Order Manully. But the issue here , when i look into the Material component list , the quantity for all required quantity are "ZERO". I suspecting