Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member185575
Participant

THIS BLOG POST IS FROM 2015 where there were some issues in the SAP Cloud Platform TRIAL edition. Everything works now like a charm!



And just to be clear: everything which involved on-premise SAP HANA + Cloud Connector always worked!!!


Hello everybody,


here I'd like to share what I have learned while trying to access a HANA XS OData service in our SAP Web IDE (cloud) trial edition. I've have been asked by several people if it is possible - and the answer is: it depends.

You could also access the services with a node.js solution by gregor.wolf!

With this blog post I don't want to start a discussion about "why is it not possible under certain circumstances?" - because there are lots of technical internal details involved. I've talked with a bunch of people and addressed the actual circumstances there.

Here I just want to highlight what you can do TODAY to give it a try. This is not a detailed step by step tutorial here, I just give you hints what you can do with certain examples, because the whole HCP/HANA topic is quite big and there are a lot of resources out there:

 

So if you have any questions concerning the HANA (privileges, shine app, sflight...) / HCP (destinations...) topics highlighted here in this blog post I'd kindly ask you to go to the corresponding SNC spaces for HANA and HCP or have a look into the openSAP courses to learn more.

If you are new to the SAP Web IDE visit our SCN space with lots of tutorials.

SAP Web IDE and SAP HANA Trial: not yet


I've been in discussions with eduard.bartsch and martin.raepple about this topic and currently it is not possible to consume the HANA XS OData services via the HCP cloud destinations in our SAP Web IDE.

It also has been asked if you could change the settings in the of the .xsaccess file to Basic or anonymous -> no it is not possible, these settings are ignored, SAML2 only.

So this means this setup is not possible yet:


SAP Web IDE and SAP HANA via SAP CAL: yes


Last week I got great help from craig.cmehil in setting up my SAP HANA system via the SAP CAL (Cloud Appliance Library) - this is basically a system hosted on AWS where you just pay for the time the machine is running. The AWS setup is also used in the openSAP courses at the beginning - later they are also using the SAP HANA Web based development environment. SAP CAL is just an super easy user interface for controlling your AWS machine.

Here is the info about the AWS with the "Getting started guide" and here is the info about the included SAP HANA.

I have used the SFlight service and used the Basic Authentication which was available by default with my database user. Here the destination settings in the HCP cockpit - the URL points to the IP-address of my AWS machine:



Working in SAP Web IDE with SAP HANA by SAP CAL:


Mock in SAP Web IDE and "importing" into SAP HANA trial Web IDE: yes


This is maybe not the most elegant solution, but you can leverage our SAP Web IDE for creating the SAPUI5 application with our SAP Fiori template, code completion, ... and use the mock data service to preview the app without the working connection. After that you could put this app into your SAP HANA trial account, make some adaptions and continue the development there.

For this I've used the sample SHINE application from SAP:



I executed the service and saved the response from $metadata as metadata.xml:



In the SAP Web IDE I created a project based on the SAP Fiori Starter Applications and uploaded the metadata.xml from my local pc:



To test the application you have to run it with mock data:



Mocked data:



After that I have downloaded the project as zip (and then unpacked it):



Then I switched over to the SAP HANA Web IDE:



In my shine application I created the corresponding packages and drag & dropped the files in the corresponding packages (no dragging of folders possible and no automatic zip-extraction possible yet):



Here are the additional steps I had to do:

index.html


I had to change the location of the sapui-core.js:
<script id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"

The one provided from the shine application (/sap/ui5/1/resources/sap-ui-core.js) had problems with the Icon Tab Bar.

Component.js


I had to reference the location of the XS service:
var sServiceUrl = "../../services/poWorklist.xsodata/";


Additional pitfalls


During development sometimes I had to run the application again so that the source was updated:



And sometimes I even had to clear the cache:



Here the final running XS application:



Maybe the steps with the file replacement are easier within your local Eclipse and the HANA tools connected to your trial cloud system, I haven't tried it out yet - I must continue with my openSAP course 😉 I will update this section after that.

HANA XS trial and beyond <<update>>


SAP Mentor gregor.wolf also played around with the SAP HANA trial XS services and came up with a node.js solution which he hosts here on github.

Update 15th January 2015

With the combined power of a blogging SAP developer girl, a hands-on SAP Mentor and a knowledge spreading SAP employee (HANA Academy) - we could fix an issue in the setup wich led to the final solution:

  • node.js SAML2 app by Gregor on your computer

  • + with running SAP HANA cloud connector on your computer

  • => which is then maintained in the HCP destinations

  • => and then consumed in the SAP Web IDE

  • => based on this you can create and deploy an HTML5/SAPUI5 app

  • = awesome stuff!!!


Here is a rough sketch which tries to illustrate this solution - I tried my best - I am a developer and not architect 😉



>>> The solution is described here at theclosed github issue. Thank you very much Gregor for your great support! That's how communities work! YEAH!!! <<<

TL;DR



  • HANA trial consuming in SAP Web IDE via HCP destination service: not yet
    .xsaccess settings could not be set to Basic or anonymous -> service is always SAML2 based due to trial restrictions

  • HANA productive or HANA on AWS through SAP CAL via HCP destination service consuming in SAP Web IDE: yes --> AWS link
    (I've seen also CORS settings in the XS seetings so maybe this is even possible without HCP destination service)

  • Mocking in SAP Web IDE and "importing" into SAP HANA Web IDE: yes

  • Accessing service via node.js with Cloud connector and destinations in SAP Web IDE: yes


Summary


I hope I could have given you some hints on how you can consume the SAP HANA XS services in the SAP Web IDE or even with node.js - thanks to gregor.wolf. If you are taking the openSAP about software development on SAP HANA you would probably already have your AWS machine up and running. The SAP HANA trial is at the moment ( ! )  from my understanding an isolated system where you can develop your XS applications, but you normally can not consume the services from the outside or via the HCP destination service (without destination service you could not consume them in your browser because they are not CORS enabled).

35 Comments