sapui5sap-web-ide

How do I add SAP Gateway services to an existing SAP WEB IDE Project?


I've imported a SAP WEB IDE project from SAP Build....

All looks great, but now I need to add in my Gateway services to handle oData etc.

I've setup my SAP Cloud Connector to and Destinations.

How specifically do I add these as all tutorials seems to start by including the service as part of a template.


Solution

  • You have to do some steps to make this work:

    1. implement the service definition in your manifest.json file:

      "sap.app": {
       [...],
       "dataSources": {
          "mainService": {
              "uri": "/your/path/to/service",
              "type": "OData",
              "settings": {
                  "odataVersion": "2.0",
                  "localUri": "localService/metadata.xml"
              }
          }
      },
      [...]
      

      },

    2. implement the model definition in your manifest.json file:

      "models": {
          [...],
          "": {
              "dataSource": "mainService",
              "settings": {
                  "metadataUrlParams": {
                      "sap-documentation": "heading"
                  },
                  "defaultBindingMode": "TwoWay"
              }
          }
      },