How to integrate SAPUI5 apps developed on ABAP repository in HANA Cloud Platform - sapui5

The scenario is to use already developed SAPUI5 applications on ABAP Gateway as portal widgets in sites developed through SAP HANA Cloud Platform,portal service.
I know we can add the ABAP backend gateway services using HANA Cloud connector and destination in HCP cockpit.
How to do we deal with the SAPUI5 applications.
a) Do we need to export them from the ABAP repository and import them into HCP web ide?
b) Can we directly deploy the same application on HCP as well and access it on the site?
In above both cases, what about the service calls made from within the app? wouldn't the urls be changed once the app is moved/imported to HCP [assuming app only makes call to relative urls.]
Any information/Documentation on this would be really helpful.

to both a) and b) my answer is Yes. With some reservation for a) as actually I just don't know of another method to deploy existing SAPUI5 apps from backend to HCP.
In my case the scenario was the following:
First, we installed HCP connector, linked it to existing S-users, then I defined a destination in my HCP account. Be aware that you have to add some specific attributes to the destination to make it available in WebIDE.
My task was to extend some existing SAPUI5 applications, so I imported them into WebIDE and it appeared that they worked just fine when running via WebIDE without changing a single line of code or configuration. Apparently they can be deployed to HCP as a standalone apps or as a part of Fiori launchpad.

Related

SAP Cloud Foundry SAPUI5 Fiori Multi Tenant App

I'm trying to add the multi-tenancy support for my existing SAPUI5 Fiori apps in cloud foundry.
But I'm unable to find documentation for multi-tenancy of the SAPUI5 Fiori apps.
However, there are many articles for CAP application multi-tenancy.
Currently, I have a provider account and multiple tenant accounts. And my fiori applications are deployed to Provider account
First thing you need to have an Approuter module, to be able to isolate each tenants identity provider.
Second thing is just deploy your applications to an HTML5 Application Repository app-host instance and bind HTML5 Application Repository app-runtime instance to your approuter.
Then you will have a multitenant frontend application in SAP BTP CF Runtime.

Creating HTML5 applications in SAP cloud platform

I am new to SAP CP. I have built a webpage which has html, css and js files. I want to deploy the same in SAP CP and then do the backend (js) and bind to the hana database.
A few doubts regarding the same:
Can I deploy the same as HTML5 apps in sapui5 or I need to package it
as a war and deploy to Java apps?
How can I Bind a database to the same?
Also please note that I have not selected any template from sapui5 its an custom project the whole idea is to run a htnl5 web app in sap CP.
Any guidance will be great.
There is no need to use a war and deploy it as a Java app here as this is pure HTML5 app.
With HTML5, you would usually consume database content using REST API (OData for example) that you have exposed and not via direct SQL like you would do in Java with JDBC.
Therefore you won't bind a database to a HTML5 app, but a REST API endpoint that will provide the database service you expect to read/write etc from.

How do I deploy only certain parts of an app to SAP Cloud Platform?

I've imported an existing SAPUI5 app into SAP Web IDE and wish to deploy it to Hana Cloud Platform (HCP) SAP Cloud Platform (SCP) SAP Business Technology Platform (SAP BTP).
Unfortunately the structure is not just one app, rather 3 apps within a parent app folder.
When I deploy to HCP SCP SAP BTP, it simply picks up the first app and ignores the other 2.
Can any of the config files (neo-app.json etc) be changed to allow specific folders to be deployed?

How to use an SAP ABAP RFC in SAPUI5 without using NetWeaver Gateway?

There is an SAP ABAP standard table that I'm trying to access in SAPUI5.
I have created an RFC. How do I use this RFC in SAPUI5 to get the data there without using NetWeaver Gateway?
You can use a rest service or Web Service on the SAP system and consume the URL in your SAPUI5 application. You can create a SICF service and developer a handler for the service. In the handler you can fetch the content from the table and return the content.
Thanks and Regards,
Veera
I agree with Veera's answer and think that this is the best way of doing it without the Gateway when your application is deployed on the ABAP system (i.e. in the BSP repository). For completeness sake, I will also describe an alternative way of doing it if you are interested in exposing the application on the HANA Cloud Platform (HCP).
ABAP RFCs can be consumed through the HANA Cloud Connector (HCC) by HCP applications. So, if you would want to put your application in the HCP, then an idea would be to expose the RFC through the HCC, consume it e.g. in a Java application and the expose it to a UI5 app through this Java app (e.g. with a Servlet or a JAX-RS service). You can find an example of such a scenario in this repository and here you can find the SAP documentation about this.
Another HCP example is SFlight Sample Application.
Open source python and nodejs rfc connectors are also available, if RFC connection required.

Adding Destination in Hana Cloud Platform

I have a HANA cloud Platform account. When I create a SAPUI5 Application in web-ide, I do not see the services(xsodata) that I developed in web-based development workbench.
Is it because the host changes for each service provided through the cockpit i.e.
for HANA services, it is:
<schemaName><accountname>.hanatrial.ondemand.com
and for web-ide:
webide-<accountname>.dispatcher.hanatrial.ondemand.com
Should we be creating destinations every time we want to consume a service developed in HCP itself.
Thanks.
Yup, that's right. You need a destination in order to be able to access your services, whether it is a XSOData service, or any other service for that matter.
Do keep an eye on the Additional Properties of your destination. If you don't set them, you still won't be able to use the destination from WebIDE.