Skip to Content

Background

One of my favourite things about this SAP Community is the worldwide nature of it. In that you can have interactions with people from all over the world on the shared topic of SAP technology. SAP is a worldwide company and that in itself is a pretty amazing achievement from my point of view. Also the fact that SAP is a worldwide company also sometimes fits into my interest in maps. So for this blog I combined two previous ideas into one to highlight the worldwide nature of the SAP Cloud Platform.

The first blog covered a way for SCN members to register on a map hosted on the SAP Cloud Platform.

https://blogs.sap.com/2015/08/22/its-an-scn-world-on-the-sap-hana-cloud-platform/

The second blog covered a way to map SDN points around the world with Google Earth via ABAP generated Key Markup Language (KML).

https://blogs.sap.com/2011/09/01/thematic-mapping-scn-points-with-kml-and-other-thematic-map-examples/

The combination of these ideas would be to generate a Google Earth KML tour of the SCN users who had registered their location on my map. Highlighting ( I think :)) the worldwide nature of the SAP and the SAP Cloud Platform.

One additional point about Google Earth KML tours is the ability to add sound. SAP Cloud Platform team have a podcast which is hosted by OpenSAP. It has its own wiki page here

SAP Cloud Platform Podcast Episode Guide

https://wiki.scn.sap.com/wiki/display/SAPHCP/SAP+Cloud+Platform+Podcast+Episode+Guide

I chose to use episode 37 as a soundtrack for the Google Earth tour.

https://open.sap.com/static/podcastgen/index.php?name=2018-02-08_cloudplatformpodcast_episode37.mp3

A particular reason to pick episode 37 was the ability to highlight SAP Labs Bulgaria as a location on my map. During my time learning about and using the SAP Cloud Platform I have enjoyed the content published on this site from the SAP team in Bulgaria – early on with Neo on the Java side with questions  and later with my first taste of HANA via the SAP Cloud Platform using Stoyen’s blog here (It still remains my favourite blog, in it’s original format, on this site but now outdated) . Also my  thanks to Moya Watson on the SAPCP team for the work she does highlighting community and SAP contributions to the SAP Cloud Platform.

I approached Moya with a request to use an extract of the podcast to use on a YouTube example of the tour.

Locations for the Google Earth Tour

From my blog “It’s an SCN World” I had created the following map of all users who had registered.

Map Tiles © 2018 HERE        

My aim was to generate a Google Earth Tour by creating an appropriate KML file to visit each location.  I also added SAP offices in the U.S using the Data Quality Management SAPCP service and I manually added SAP Labs Bulgaria to the map for the tour.

 


Guide to the Google Earth KML Tour

 

The best experience for the Google Earth tour from my experience is the desktop based application. There is also Google Earth for the Chrome browser but from my experience on several desktops (windows and mac) Chrome does not play any soundtracks for any tours.

As mentioned I wanted to use the SAPCP podcast to play alongside the my KML tour of SAPCP users and SAP locations around the globe.

Each pushpin icon (below) represents an SAP Cloud Platform user who registered on my map covered in my blog “It’s an SCN World” (apart from one icon which was added during my testing )

source https://maps.gstatic.com/mapfiles/ms2/micons/ylw-pushpin.png

My example location below.

The “SAP World Tour in the red box needs to be selected to start the KML tour.

Anonymous SAPCP Users

During the tour I have chosen to label most locations as “Anonymous SAPCP User” to represent an SAP Community member who registered on my map.

Thank you Tammy and Helmut

I reached out to some member of the SAP Community who had registered on my map. And two members Tammy tammy.powlas3 and Helmut helmut.tammen2 agreed to still remain on my map. All other locations on the tour have been changed to anonymous as mentioned.

I have also added some locations that are not part of the tour but static points of interest as follows.

 


Guide to the Google Earth KML Icons

The following icon links to photos hosted on the  FLICKR website. I have used hashtags to extract SAP related photos from the site using it’s API.

flickr source https://maps.google.com/mapfiles/kml/shapes/camera.png

The icon below links to SAP Community Inside Track blogs by using the Geonames.org service to Geo locate RSS feeds. I used the RSS feed of the Inside Track Tag on this site and Geonames added the location details. This is not perfect and sometimes a location is a completely different country!! It does not represent the actual location of the Inside Track but a representation of the data.  Some mistakes are inevitable using this automated conversion. But for example it picks out the Inside Track at Copenhagen but not at the actual location. (maybe bloggers could use tags of the geotagging format 🙂 )

Inside Track source https://maps.google.com/mapfiles/kml/shapes/poi.png

 


The SAPCP Google Earth Tour KML file and video

 

The KML file can be downloaded at the link below. Depending on the specification (CPU/Memory) of your PC it may be best to reduce the viewing area of Google Earth as there is a 15 second pause at each stage of the tour (to load the image data). This was tuned to my computer (hey works on my machine! alright I had to try on another computer as well 🙂. From my experience there can be an issue with the sound not playing on first attempts. In Google Earth select the following in preferences – Preferences->General->”Allow cross-origin requests from local content”. I have found this setting triggered the sound but I could then deselect this option without losing sound!! maybe be a feature of the software on both Mac and Windows :). 

SAPCP_GE_TOUR_PUBLISH.kml

An extract of the tour – From Palo Alto to SAP Labs Bulgaria – I asked and was granted permission to use the audio from the Podcast. You can use Google Earth in YouTube videos ref link

https://wiki.scn.sap.com/wiki/display/SAPHCP/SAP+Cloud+Platform+Podcast+Episode+Guide

 

 

 


Overview of the Setup

If you are interested in some of the technical details on how I created the Google Earth Tour then keep reading. Only technical information will be covered from now on.

 

My Github Code

 

I have chosen to use Github for the first time to publicly share code I have created. I have had a Github account for a while and previously shared some GeoJson but now decided to use it for my own code projects. Also thanks to OpenSAP and Arnaldo Cavazos for running the excellent Git Course https://open.sap.com/courses/git1 I get to practice Git with my own code. I am not going to cover much of the code as quite a bit is depreciated (an old UI5 library and my base ABAP code is based from 2011 :)) ) although I am happy I worked it all out to get to my final Google Earth Tour.

 

I can use my Github repos to revisit and update some parts particularly the UI5 code used to register locations on my map. The aim of this blog 🙂 was to produce a Google Earth tour not necessarily with the latest code/styles. Obviously with the fast changing nature of Cloud and On-Premise HANA who knows what is next – I didn’t anticipate learning about XS Classic for it to reach a dead-end so soon. However with the Neo environment in particular XS classic appears to be around for a while longer.

 

  • My SAPCP repo

https://github.com/rjruss/ZRJRUSS_XSC

  • My ABAP repo, thanks to ABAPGIT and I was able to extract my code from nuggets to Git fairly easily.

https://github.com/rjruss/ZRJRUSS_ABAP

The code will not work with just a direct clone there are some setup steps that are covered below for both  the SAPCP and ABAP repos.

 


Data Quality Management, Microservices for Location Data

I always try and use SAP technology rather than other services and this was the case for my geocoding attempts for SAP offices world wide. I chose to use SAP’s own geocoding service to locate their offices around the globe.

30 day race to complete

As the Data Quality Management (DQM) Trial accounts are limited to 30 days this did limit my use of this service. In that it was my own spare time and own personal interest in the subject matter meant my own time was limited during this trial period. So I focused on getting a result and not setting up this service with any intention of using it long term (because I can’t use it beyond 30 days !) . So for example I chose to use an Oauth token for 90 days and that’s probably not an approach I would take for any real implementation. However, having said all that I did enjoy the challenge and approach of this service to get the geocoded locations of the SAP sites. In the end I manually added the SAP Bulgaria office to my map as the SAP service does not cover Bulgaria (at the time of writing). It would be great if the 30 day limit could be extended, maybe SAP could reduce the geocode accuracy drastically after 30 days or gradually reduce the API limit allocation over time.

 

There is a great getting started Github guide to the DQM service. On this repo there is a link to a Postman collection of very useful calls to the service.

I based my work on this repo

https://github.com/SAP/cloud-dqm-sample-payloads#cloud-dqm-sample-payloads

Also a key step for me was the oauth token – link to the Github section to set this up.

https://github.com/SAP/cloud-dqm-sample-payloads#requesting-an-oauth-token

 

My (hidden :)) bearer token below, as I would use Postman again to store this (and my HERE API keys) in my SAP Cloud Platform XS classic services. I’ll cover how I did it and tackled cross site requests using Postman later on.

My final config for my DQM service is as follows.

I was not interested in any mass geocoding just checking and adjusting one address via a web page.

To use this config I created a JSON payload referencing the configuration by name and my service was limited to *SAP sites only*.

 

'"configurationName": "GEOwithCITY" ' +

 

Link to the full relevant section in my code

30 day limits mean it’s all commented out and won’t work on a direct clone

As the DQM service is so restricted I have commented out the call to the service in my Github repo. At the moment it would return the location of SAP Palo Alto by an hard coded JSON structure.

Link to the relevant section that would need to be adapted to again call my setup of the DQM service.

Also the xshttpdest file would need to be adapted to point to the correct end point of the DQM service.

Example of how it works below by geocoding SAP’s office address for Newtown Square and then I move the location.

Map Tiles © 2018 HERE  

 


XS Classic Code and HANA details plus post Clone activities

 

For my setup of my SAP Cloud Platform trial account I use one user named NEOGEODB which as extensive authorisations.

I Git clone my XS Classic code/files to a package called RJRUSS. This would need to be adapted in the code/config files if it changed. E.g. the table definition I use references to the namespace rjruss.neogeoxsc

I use a schema definition file hdbschema to define a schema call RJRUSSLOC and I would have to use a _SYS_REPO call to grant privileges to my HANA user.

 

call _SYS_REPO.GRANT_SCHEMA_PRIVILEGE_ON_ACTIVATED_CONTENT('select, create any, insert, delete, update, execute, alter, drop','RJRUSSLOC', '{USERNAME}');

Refresh the catalog and the schema should appear for the chosen username.

 

Hiding Tokens And Keys

As I was sharing the code on Github I wanted to mask/hide the secret tokens on my public repository. There could be options to use a .gitignore file which would not include any setup of these keys however I chose to go with an xssecurestore approach and a quote from that link explains its purpose “The secure store API can be used to securely store data in name/value form” and use Postman to update this secure store. I went through the steps to keep the cross-site request-forgery protection and set the prevent_xsrf option to true in my xsaccess file (as seen in my Github repo). The HERE api keys (covered in detail below) are visible to the end user (if they dig into the browser’s developer tools) but I didn’t want to share these publicly via Github. If you know a good way to mask API keys in public source code repos I would be interested to know about it.

HERE Maps API Keys

To use HERE Maps you need to obtain an App_Id and App_Code from HERE’s developer site https://developer.here.com/plans

In my code I read in these keys from the xssecurestore as follows

var here_id = read('app_id');

var here_code = read('app_code');

 

To populate my securesore with app_id and app_code values using Postman I first needed an xsrf_token. I used a GET call to my base project rjruss/neogeoxsc with an Header X-CSRF-Token set to fetch. As shown below.

 

In the Header section a x-csrf-token is returned and can be used in my secure store process.

With this x-csrf-token I can call the code secureTokens.xsjs with the parameter cmd=store and POST with Postman, as shown below.

The body of the POST using app_code as an example – important to change the value as appropriate. I use a xsjs service called secureTokens.xsjs

I would also have to add the DQM Oauth Bearer token to my secure store and the payload I used was as follows.

{
   "key": "dqm_code",
   "value": "{enter_the_DQM_Bearer_Token_value}"
 }

 

So all the above so far meant I had could register all the locations I wanted to add to my Google Earth Tour.

I have no idea how to create a Google Earth tour with Javascript/XS Classic code. However from my previous experience.

Enter ABAP.

 


Connecting My ABAP NPL Trial With My SAP Cloud Platform HANA Instance

I setup my NPL system with the SUSE 42.3 version as per the getting started guide here.

There could be a few options to expose the location data I had in my trial SAPCP e.g. via cloud connector and Odata services. In the end I chose the following method based on secondary database connections. The first requirement was to….

Install HANA Client

I downloaded the HANA Client from the developer tools site

https://tools.hana.ondemand.com/#hanatools

Install process is covered here.

With my demo system I used the gui install running as the npladm user on my SUSE system.

Before su-ing to the the npladm user I allow xwindows to display (everywhere)

As root

vhcalnplci:/var/tmp # xhost +

access control disabled, clients can connect from any host

Then su – npladm and ran the hdbsetup installation from the temp download directory containing the extracted client.

From my experience with the NPL trial 751 installation then the LD_LIBRARY_PATH is already set for the NPL user npladm. So as shown above I installed to this directory (as this did not exist on my trial system)

Setup TUNNEL to SAP Cloud Platform

 

I downloaded two more items from the developer tools site, this time from the Cloud page.

https://tools.hana.ondemand.com/#cloud

I downloaded Java Web Tomcat 8 from the “SAP Cloud Platform Neo Environment SDK” section and SAP JVM 8 from the “SAP JVM” section. I extracted the downloads to sapjvm and neotom8 directories as per the commands below.

Console command to open the tunnel.

Set the JAVA_HOME

export JAVA_HOME=/home/sap751/sapjvm/sapjvm_8

Change directory to the Tomcat 8 SDK as an example I use a unix user called sap751.

cd /home/sap751/neotom8/tools

Run the command to open the tunnel

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/9e3f90f2ead74229ac5c8848ed5bf292.html

 

./neo.sh open-db-tunnel -a <subaccount_name> -h <host> -u <user> -i <schema_ID>

 

Once the tunnel is successfully opened then the setup in SAP ABAP can take place.

Below screenshot is from the DBACOCKPIT -> DBA Connections option. As the tunnel is being used then the host is localhost and port will be listed when the tunnel is open.

As shown below from my setup.

 

Tunnel opened.

 

Use these properties to connect to your schema:

 Host name        : localhost
 Database type    : HANAMDC
 JDBC Url         : jdbc:sap://localhost:30015/
 Instance number  : 00

 

You can also use transaction DBCO to setup the connection to HANA in the SAP Cloud Platform and test with program ADBC_TEST_CONNECTION (in se38). As this program has an easier screenshot for me to use, I’ll use it to show how to confirm the connection to HANA is available.

KML Tour ABAP Setup

I had to update my code to work with my LOCATION table in HANA on the SAP Cloud Platform. My code uses NEOGEODB as the name of the secondary database connection.

I found a method to work with HANA in the SAP Cloud Platfrom from Thomas Jung’s blog here about using secondary database connections https://blogs.sap.com/2012/04/11/test-16/ (particularly the “This is the concept of ADBC – ABAP Database Connectivity” section)

I also used the help in regards to using an internal table I setup for the KML tour.

https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenadbc_dml_ddl_bulk_abexa.htm

The selection for my program ZSAP_CLOUD_PLATFORM_GE_TOUR

The MP3 section allows a soundtrack to be played with the Google Earth Tour. The MP3DELAY option would be used to delay starting the second MP3, if referenced in MP32. From my experience with Google Earth then the MP3 files need to be served on HTTP pages and not HTTPS (Google Earth seems to only recognise MP3 via HTTP)

The DELAY of 15.0 indicated the pause at each location in the tour. This can be important as it depends on the computer speed and internet connection to allow the Google Earth images to be displayed. E.g. if it takes longer for the images to form then the DELAY can be increased. The GEOUSER and ENABLEGE are linked to the geocoding of RSS feeds with the geonames service referenced earlier. Creating your own geonames user is recommended as the demo user may crash the code – as I expect everything to work 🙂 and do not capture potential errors!!. The UTAGS, FLICKEY and ENABLEFL are related to the Flickr web site. The UTAGS hashtags are used to identify photos on Flickr that are geocoded and then placed on the map. A Flickr API key is required to enable this (as again my code will crash if this is not setup correctly). The SAVEKML parameter is used for the final KML file’s download location on the local computer (on a Mac you would need a terminal session to find the default location in the code – so it is better to use your own location for the download).

Thanks for reading….

 

References

Data Quality Management, Microservices for Location Data

https://help.sap.com/viewer/d95546360fea44988eb614718ff7e959/Cloud/en-US/f2e5574c6dbc40c8ab1fa2ca12a02672.html?q=service%20fields

Google KML tour reference

https://developers.google.com/kml/documentation/touring

Create a KML tour and without all of the above :0

https://tourbuilder.withgoogle.com/

HERE maps developer site

https://developer.here.com/

Google Earth can be used on YouTube videos ref

https://www.google.co.uk/permissions/geoguidelines/attr-guide.html
https://www.google.co.uk/permissions/geoguidelines.html#maps-web

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Moya Watson

    It’s the generosity of sharing from folks like you that really inspires me about the SAP Community, Robert!  You and so many dedicated SAP users take the time to not only share your work on the community, but consistently call out others as well – -all in the service of the amazingly creative technology you create!  Thanks for the shout-out and thanks for shining such a great light with your geo-wizard skills and your amazing self  !

    (1) 

Leave a Reply