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: 
lsubatin
Active Contributor
You’ve come a long way, but this is the final step before the visualizing fun:

This will be about installing the HANA Analytics Adapter. I will also test the live connection from SAP Analytics Cloud.


Deploying the HANA Analytics Adapter


I will be using the CLI from the console in the operating system of my HANA instance (you could install it and use it locally too: https://developers.sap.com/tutorials/hxe-ua-install-xs-xli-client.html). This also means I had to upload the zip file to the operating system.

Install the HANA Analytics Adapter


Log in to the CLI with a user powerful enough to perform installations in the development space:
xs login 
xs target -s development



You can now
xs install <<full path and name of the zip file>>

Give it a minute and let her work her magic:



Remember the diagram in the previous post? Here are all of the components I had promised:



Take note of the URL and port for xsahaa-entry. That is the approuter and you will need that to connect from the analytics tools.

Test it


Open a browser, and paste that URL. Use HAAUSR to log in… and Ta da!



If you are like me, after all of this effort, this page makes you very happy. Let’s do some real testing now (after all, that message does not really mean anything).

Add the following to the URL:  /sap/bc/ina/service/v2/HeartBeat

 



This one is not as pretty but you are now getting the backend module to execute something.

Modify CORS


If you unzip the file and check the mtad.yaml descriptor, you will see a variable for the approuter called CORS. By default, it is set to not accept requests from other origins, which is inconvenient when an external server like SAP Analytics Cloud is performing the request.

This is what xs env xsahaa-entry shows:



Create a file called cors.txt and add the following text in it (replace the host with your host for SAP Analytics Cloud😞
[
{
"uriPattern": "^/sap/bc/ina/(.*)$",
"allowedOrigin": [
{ "host" : "yourhost.sapanalytics.cloud", "protocol":"https" }
],
"allowedMethods": ["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE"],
"allowedHeaders": ["Origin", "Accept-Language", "Accept", "X-Requested-With", "Content-Type", "Access-Control-Request-Method", "Access-Control-Request-Headers", "Authorization", "X-Sap-Cid", "X-Csrf-Token"],
"exposeHeaders": ["Accept", "Accept-Language", "Authorization", "X-Requested-With", "X-Sap-Cid", "Access-Control-Allow-Origin", "Access-Control-Allow-Credentials", "X-Csrf-Token", "Content-Type"]
}
]



Set the new content of the CORS variable with:
xs set-env xsahaa-entry CORS --from-file cors.txt
xs restage xsahaa-entry
xs restart xsahaa-entry


Accepting that self-signed certificate


One more thing before you can connect… HANA Express brings a self-signed certificate. You can get yourself a proper, secure certificate signed by a Certificate Authority.. or you can insist on connecting anyways if, after all, you are just practicing and security risks such as a man-in-the-middle attack do not worry you.

If you tried to connect from SAP Analytics Cloud you would get a message saying something like “SSL certificate untrusted”. Analysis for Office would not even give you an error.

So let's do a quick and dirty (insecure) workaround to that.

Right-click on a site that is logged in to XSA, click on certificate and follow the instructions to download a certificate (this works with Chrome):





Follow the wizard until completion. Remember where you are saving the certificate.

Now run mmc . File -> Add/remove snap-in -> Certificates (Add >):



Right-click on the certificates under Trusted Root Certification Authorities and Import the .cer file you exported.



(Sorry Mac users, please feel free to post the instructions in the comments or in your post)

Create a Live Connection from SAP Analytics Cloud


You can now proceed to connect from SAP Analytics Cloud!



(This is why you needed to rename your instance, because hxehost will not work... SAC does not know what you have mapped in your hosts file)

Use the Live Data connection option, because you can now:



 

I'll let you guess how to fill the model configuration. If you made it all the way here I'm assuming you are among the smart ones. The Data Source should list your calculation view.

And who is that lovely K-anonymity view over there? We are ready to rock and roll and create information out of data and then intelligence out of information.

In a pretty way and without a clue about aesthetics (that's what I like about this tool...)

 

I hope this has been of use! A special thanks to ingo.siebeking, one of the makers of the connector, for all the support along the way.

I'll be playing with my new connection and posting later. So stay tuned on Twitter or LinkedIn!
22 Comments