Skip to Content

How to get HCP WebIDE invoke an MDC OData service

I am developing an SAPUI5 template Master Detail application with the HCP webIDE. I have a HANA multi-tenant database MDC through my trial account. I have a sample SAPUI5 application I have developed using the webIDE within the MDC that invokes the OData services no problem. The webIDE within the MDC does not have the nice templates and graphical editor. I would like to develop the application using the HCP webIDE templates since they have the WYSIWYG capabilities with the graphical editor.

I created an HCP destination to my OData service but even though the test connection works with the basic authentication credentials, I am not able to pull up the entities during the design time template HCP SAPUI5 template wizard screens. So I read through several discussions and saw a recommendation to create an EDMX file based on the OData metadata and instead point to this during the wizard. I did that and my SAPUI5 template generated app works in App in FLP Sandbox mode. I was also able to export this app into my MDC content repository and then adjust the neo-app.json and manifest.json files to point to the OData service and change the reference to the SAP Javascript libraries to get this to work. But this is really tedious if I want to continue developing on the SAPUI5 app in the HCP WebIDE.

Is there a simple way to have the HCP WebIDE actually integrate to the MDC OData service without having to implement a workaround NodeJS or other proxy approach? I have read the article - "CORS Issue while consuming Hana's OData" Can't I simply add the CORS configuration through the XS admin tool to enable Basic Authentication and the HTTP methods? I am able to invoke the OData service through the Chrome console but am running into the error: XMLHttpRequest cannot load$metadata. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.

The workaround approach articles were written a while back - so I am wondering if SAP has a simpler solution by now.

Thanks for any help in advance.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 14, 2017 at 04:31 PM

    Actually - I got this to work. I think it was an authentication issue and also a matter of defining the correct information in neo-app.json and manifest.json. I created the following xsoaccess file and placed this in the same folder with my xsodata service in the MDC content repository.

    The destination in HCP is set to Basic Authentication.

    Here is my xsoaccess file:

    { "exposed" : true, "cache_control" : "must-revalidate", "cors": { "enabled":true, "allowMethods": ["GET","POST","DELETE","PUT"], "allowOrigin": ["*"], "maxAge":"3600" }, "enable_etags" : false, "force_ssl" : false, "prevent_xsrf" : false }

    So for anyone who wants to use their trial account and use the HCP WebIDE SAPUI5 templates and call an OData service implemented in their MDC HANA content

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sonja,

      If you have OData services defined for your tables, you should be able to simple send JSON/XML to the OData service. POST - will be for creating new entries. PUT will be for updating entries. UPSERT would work for Update/insert. If that does not work, simply creating an XSJS that reads the request and insert the data into the MDC tables through SQL. I created a BLOG on how to insert an image which is more complex than you need since your data is just text - but you can refer to this: How to Post an Image from SAPUI5 and Store in HANA DB as BLOB using XSJS

      I hope this helps. Sorry for the delayed response.



  • Feb 28, 2017 at 08:10 PM

    Any approaches to address this?

    Add comment
    10|10000 characters needed characters exceeded