One of the main use cases for HANA Cloud Platform is extending the on-premise solution by providing an agile innovation layer for customers to build rich applications. Over the past few weeks, I had several questions around how we could create applications on HANA Cloud Platform which consume the data from an on-premise Business Suite on HANA system. There are lots of articles on SCN which show how to expose ABAP based OData services from a SAP system (which runs on anyDB) and consume them in SAP WebIDE.
In this blog, I wanted to describe how we can create an application in SAP WebIDE which directly connects to an on-premise SAP Business Suite on HANA system. You can now create applications which provide information in real time.
The architecture is exactly the same as what we would follow when dealing with an on-premise SAP system (which runs on anyDB). HANA Cloud Connector is installed on the customer’s premise and it establishes a secure tunnel between the backend system and the HCP account.
Model your business data using HANA
To demonstrate this, I am going to create a bunch of CDS objects in my HANA system which creates a table and expose the contents of this table as an XS OData service. This is only relevant when you want to create a brand new application. In most of the cases, customers would want to use their existing transactional data from SAP tables, model them with additional tables and provide a set of HANA views for consumption.
Open your HANA Studio and create a package called sample and add an application called perslist (you will find perslist used in many sample applications on SCN). Create the below files under this package.
Add .hdbdd file which creates yourmodel (person table)
.csv file which contains data to be uploaded to the above table
.hdbti file which uploads the contents of the csv file to the table person
.hdbrole file which provides access to the model
.xsodata file which exposes contents of the model
This is how the folder structure is with all the objects activated
Add the newly created role to the user as shown below.
Navigate to the catalog to view the contents of the table
Open the browser and test the XS OData service
Setup the HANA Cloud Connector
We have now got an OData service which pulls the information stored in the HANA system. Next, install the HANA Cloud Connector (SCC) and setup a connection with your trial HCP account. Follow the steps documented here. Under “Access Control” I have added a new entry pointing to my HANA system. Notice that I have provided virtual hostname and also enabled access for all resources under the package “sample”. This completes the setup of the HANA Cloud Connector.
Configure Destinations in HANA Cloud Platform
In your Trial HCP account, navigate to Destinations and add an entry pointing to the virtual hostname configured in the HANA Cloud Connector.
Build SAPUI5 Application using WebIDE
Launch SAP WebIDE and create an application based on SAPUI5 template. You will see the following structure with a view and controller.
Open the neo-app.json file and add a destination as shown below. Use this destination within your controller to retrieve the information from the backend system and display it as a table in the view.
Below is how my sample application will look like based on the data retrieved from the backend HANA system.
The example I have used is just to showcase how you can create new models in HANA and expose the contents in HANA Cloud Platform. You can use the same concept to extend your on-premise system by mashing up with other information and exposing the transactional data from your on-premise system. Hope you found this useful.