Connection Between SAP Analytic Cloud and Cloud Foundry HANA DB
SAP Analytics Cloud provides the business logic and builds the queries required to see your data in your browser. This blog will explain on how to establish live data connection in SAP Analytics Cloud (SAC) to SAP Cloud Platform.
Why this solution ?
- Installing Prerequisite Tools.
- Download SAP HANA Analytic Adapter WAR file
- Build and Deploy HANA Analytic Adapter in SAP Cloud Platform, Cloud Foundry.
- Cloud Foundry Command line interface
- Oracle JDK 8.
- Apache Melvin.
- Node Package Manager & Node.js.
1. Installing Prerequisite Tools
1.1. Install Cloud Foundry Command line interface
We need Cloud foundry command line interface to build and deploy the node.js application in SAP cloud platform Cloud Foundry Space.
Download & Install Cloud Foundry CLI.
Note: Make sure to define CF CLI in environment variable.
1.2. Install Oracle JDK 8
Download and install Oracle JDK8. To confirm the successful installation, execute the command java -version, the output has the Java Version.
Note: Make sure to define Java in environment variable.
1.3. Install Apache Maven
Download Apache Maven (apache-maven-x.x.x-bin.zip), extract and place the downloaded files in Program Files folder in C:\ drive.
Note: Make sure to define Apache Maven in environment system variable PATH. The same can be verified using the command mvn -version.
1.4. Install Nods.js
Download and install Nods.js.
Note: Make sure to define Nods.js in environment system variable PATH. The same can be verified using the command node –version.
1.5. Install MBT for building app
`npm install -g mbt`
2. Download SAP HANA Analytic Adapter WAR file
2.1. Add the SAP HANA Analytics Adapter WAR file (java-xsahaa.war) to the target folder. To download follow the below given link.
3. Build and Deploy HANA Analytic Adapter in CF
Important Note: So the earlier approach to build and deploy HANA analytic adapter was to first clone the repo from github and build but since that project is deprecated so we are going to follow different and easy approach. Below are are the steps to be followed….
3.1. Install YEOMAN library to generate HAA package
`npm install -g yo``npm install -g generator-saphanaacademy-haa`
Once you have successfully executed the above command then generate your project using below command..
you can even update the settings of an existing project via sub-generator
Once you generate new project it is going to ask you to follow few steps like
Project Name – Type in your project name
Create new directory for Project – Select Yes
hdi-container name – Type in your hdi container name
authorization – Select Yes
hostname of client application – Paste in client hostname
Propagate application user to SAP HANA cloud – Select Yes
HANA cloud via JWT-based SSO – Select Yes
After successfully generating a new project you would need `Cloud MTA Build Tool` to build your app. Follow the below link
Once you download the GNU make file, rename it as `make.exe` and place it inside your `haa` folder.
Once all the steps has been done then go to your project directory `haa` and run command `mbt build` it is going to build `mtar` file.
Now login to your cloud foundry account via terminal using `cf l` then select account where you want to deploy then at the end use `cf deploy <mtar file name>` to deploy your app.