+1 650 386 4000Connect now

SAP HANA Migration

Effortless migration to SAP HANA

SAP HANA Migration

Enterprises require in-memory database management systems to process complex queries and manage large volumes of transactions. Robust data systems ensure predictability, scalability and enhanced responsiveness. However, costs and downtime are concerns during migration to an in-memory platform.

Bristlecone evaluates infrastructure readiness via SAP HANA assessment workshops. It helps your enterprise understand business challenges to define a migration strategy and solution road map. We enhance the enterprise application landscape to leverage SAP S/4 HANA functionalities and implement the hosting strategy.

Our SAP SCM on HANA migration service supports real-time planning, analysis and reporting, while boosting supply chain processes. Our approach to SAP Business Warehouse on HANA implementation realizes the benefits of SAP NetWeaver Business Warehouse on HANA while minimizing training requirements. Our preconfigured offerings are certified by the SAP Integration and Certification Center.

Bristlecone services ensure smooth migration to SAP HANA:

  • Consulting for hardware, architecture and solution design
  • Diagnostics for business case, enterprise readiness and risk mitigation
  • Managed services
  • Continuous improvement, performance tuning, enhancement, and system upgrade

SAP HANA Geospatial processing feature was launched with SAP HANA SP6.This enables organizations to store their Geospatial data along with Business data in the same instance of HANA. By extending the HANA Platform capabilities customers can perform operations on spatial data like calculating the distance between geometries, determining the union or intersection of multiple objects. These calculations are performed using predicates, such as intersects, contains, and crosses.

We can illustrate the concept based on a use case on parliamentary constituencies in INDIA.


Spatial Data:

Spatial data is data that describes the position, shape, and orientation of objects in a defined space. Spatial data is represented as 2D geometries in the form of points, line strings, and polygons.

SAP HANA has brought in some new spatial data types like POINT (ST_POINT) and Geometry (ST_GEOMETRY) to store spatial information. A point is like a fixed single location in space and will be represented by X and Y co-ordinates (*can also have a Z co-ordinate in case of 3D space).

A Geometry is like a super class container and can store the below type within it.

Spatial feature in SAP HANA:

HANA Spatial delivers the ability to store and process geospatial data types like ST_POINT, ST_GEOMETRY, etc.

These data types allow application developers to associate spatial information with their data. For example, a table representing companies could store the location of the company as a point, or store the delivery area for the company as a polygon.

SAP HANA also delivers Nokia mapping services as part of the HANA Spatial features and this can be used to create apps using HANA XS engine through which Nokia mapping services can be called using the Nokia API.

Once Spatial data is loaded into HANA you can create or extend HANA models (Analytic, Calculation Views) using HANA Studio and make these models available for analysis and visualization through SAP Lumira or custom HTML5 applications. SAP HANA SQL script has been extended to support the Spatial SQL MM Standards for storing and accessing geospatial data.

Spatial Type Hierarchy:

SAP HANA has brought in some new spatial data types like POINT (ST_POINT) and Geometry (ST_GEOMETRY) to store spatial information. A point is like a fixed single location in space and will be represented by X and Y co-ordinates (*can also have a Z co-ordinate in case of 3D space).
A Geometry is like a super class container and can store the below type within it. In Geometry data type we can store any of the child types like Line, Polygon, or Point.

The following diagram illustrates the hierarchy of the ST_Geometry data types:


Below you can see how we can store and retrieve data from a Point or Geometry Type

create column table spatial_geom
insert into spatial_geom values (new ST_POINT (0.0, 0.0) );
insert into spatial_geom values (new ST_POLYGON (‘POLYGON ((0.0 0.0, 4.0 0.0, 2.0 2.0, 0.0 0.0))’) );
select shape.ST_AsGeoJSON() from spatial_geom;
create column table spatial point
point ST_POINT
insert into spatial point values (new ST_POINT (0.0, 0.0));
select point.ST_AsGeoJSON () from spatial point;

So, basically in a Geometry data type we can store any of the child types like Line, Polygon, or Point. You can also see that we are querying the data as GeoJson which is a special JSON format for encoding a variety of geometrical data structures and it is easily understood by most of the MAP client APIs.

SAP HANA also provides a list of other means to extract data from geometrical data structures apart from GeoJson like Well Known Text (WKT), Well Known Binary (EKB), etc.

Now coming to the application where-in I am showing all the parliamentary constituencies of India.

So, first I had to collect the shape files for all the constituencies of INDIA. Finally, after some amount of research here and there I finally got the data of the Indian parliamentary constituency.

The data mostly often in ESRI shape and SAP HANA supported the shape file import into it.
So, in order to load shape file into HANA you need to perform the 4 simple steps stated below:-

1. Download Putty(http://www.putty.org/) and PSCP(http://www.nber.org/pscp.html)
2. Copy the shape file(zip it first) from your local machine into HANA using PSCP
3. You can login to your server using putty and unzip the files.
4. You can import the shape files in HANA by running the below command.
   IMPORT “Schema_Name”.”Table_Name” AS SHAPEFILE FROM ‘path to shape file’

So, once I imported my shape files into HANA, the data looked like below:-


So, as you can see I had the list of all the constituencies along with the following information:-

1. The state to which it belongs, the ruling party, area, and the color code(some of the fields were added later).
2. The shape information.

I can also see the shape as GeoJson and the data looked like as shown below.


So, you can see that most of the shape are really complex and are created using polygons and multipolygons with a large number of points.

In this part, I will show how the data was exposed from HANA as GeoJson using XSJS and its consumption by Leaflet Map Client.

The application basically supports two features:-

1. It displays all the parliamentary constituencies and on hovering on each of the constituency, you can see more details about the constituency.

2. You can draw a polygon or a rectangle in the MAP around the constituencies and you will get the number of seats won by each party for constituencies which comes within the area of the polygon or the rectangle.

I have created 2 XSJS service for each of the above two features.

For the 1st feature, I am selecting the constituency information along with the shape information and returning the data in GeoJson format.
The ST_AsGeoJson() is a function provided by HANA Geospatial which can be used to return the data in GeoJson format. I am fetching the data in this format and adding it to a FeatureCollection as you can see below.


The results returned by this service are shown below:-


You can add as many features(like ST_NAME, color) you want under the feature collection but the shape will be stored under the geometry section of each feature as seen above.

The second XSJS service will be triggered whenever you draw a polygon on the MAP. I get the polygon co-ordinates using the MAP APIs and call the service by passing them as input. Inside the service I try to fetch all the constituencies which lies within the polygon by using the Geo-Spatial Function ST_Within() as shown below.


The results returned from this service will look like as shown below.


I am consuming the data returned from the XSJS service in my HTML5 application using AJAX. I used Leaflet.js APIs to plot and display the MAP.

It is done by following the below steps:-

Step 1 :- In Leaflet.js you need to first create a MAP instance and linked it to your map div.

var map = L.map(‘map’, {
zoomControl : true
}).setView([ 22.527636, 78.832675 ], 4);

Step 2:- You need to add the tile layer to the map. The tile can be of anything as leaflet is open source. It can be of Openstreetmap as well as Cloudmade.

Step 3:-  Then, you can do an AJAX call to get the constituencies data in the form of GeoJson and add it to the map.

function querystates(statesData){
url: ‘../model/geodata.xsjs’,
data: statesData,
success: function (statesData) {
geojson = L.geoJson(statesData, {
style : style,
onEachFeature : onEachFeature

Step 4:-   On Each Feature which is nothing but a constituency you can perform further actions on mouseover, mouseout, etc.
function onEachFeature(feature, layer) {
mouseover : highlightFeature,
mouseout : resetHighlight,
click : zoomToFeature

And that`s it the application is up and running. For drawing shapes on MAP we need to use Leaflet Draw APIs which can be found in the link Leaflet/Leaflet.draw · GitHub.

You can also find the entire code for HTML 5 UI as well as the XSJS in the GITHUB link stated here:- https://github.com/trinoy/gisdemo.
where in you can see how I am using the Leaflet Draw APIs to create the shapes. The main file for drawing the MAP is map.js which is available under the UI/JS folder.




Click here for more assets

Get in touch with us.

Learn how Bristlecone Supply Chain services can help you uncover your company’s operational deficiencies, and transform your firm’s complex and diverse Supply Chain networks into an optimized ecosystem.

Contact Us