среда, 20 сентября 2017 г.

The next blockbuster is HERE: SAP TM 9.0 maps display

As soon as you started digging SAP Transportation Management (in my case 9.0), you will be very interested in GIS & maps integration and using it in your business scenarios.
Let's review GIS & maps functionality as it is in SAP:
  • Map display - shows maps in SAP Web Dynpro environment
  • GEO-coding - derives the geo coordinates from an address (reverse geocoding is opposite - defines the address from geo coordinates)
  • GEO-routing (including Distance and Duration determination) - builds a route between points and calculate distance and duration of the route
This article will be dedicated mostly to what we can do without ABAP coding.
Let's start from map display, the TM version is 9.0.
For maps and some 3D figures SAP has implemented a special add-on named SAP Visual Business, which must be installed on every client PC. Along with Transportation Management 9.0 you can use only Visual Business 2.0 with Net Weaver Business Client 5.0.

Block 1: Basis and installation pre-requisites

Pre-requisites for map display on a Server - side are:

  • to install SAP_BS_FND -- SAP Business Suite Foundation component (backend installation, SPAM ):
 
  • to activate ENTERPRISE_BUSINESS_FUNCTION FND_VISUAL_BUSINESS in SFW5:

  • switch on map display in SPRO
SAP Transportation Management -- Transportation Management -- Basic Functions  -- Geographical Map -- Define Settings for Geographical Map

Pre-requisites  for map display on the every Client - side are: 

  • install SAP VISUAL BUSINESS 2.0 (media disk 51043596),
    otherwise you'll get an error GAC: Method/property does not exist
  • install certificate  (t-code ACF_WHITELIST_SETUP or WDR_ACF_WLIST, select certificate ‘VB200’ and press ‘Install Certificate’)

  • optional: install SAP Netweaver Business Client 5.0 (media disk 50131526_6) or you can work with TM functionality without NWBC directly from the Internet Explorer, the link is https://ehp5.tpc.com:8003/sap/bc/nwbc 
    (constant part of URL is highlighted) 
Block 2: Settings for Alpha - map provider
I advise you to pass the procedure of map-customizing having the one map-provider. In SAP documents there are lots of obsolete links, so you can start from those which works and later to configure additional map-providers through the same procedure.
As the Alpha-map provider I advise you to choose HERE.
Later I will try to compare a couple of other map&GIS providers with HERE.
To work with HERE you have to register under the link below (free plan restricted by 15k requests per month).
https://developer.here.com/plans?create=Public_Free_Plan_Monthly&keepState=true&step=account
After registration you will get App Code (token) and App ID.
SAP uses map data represented as tiles and you can find Map Tile API under the link below:
https://developer.here.com/documentation/map-tile/topics/quick-start.html
Having your App Code (token) and App ID on hand you can maintain the URL for the map service.
Map tile URL have the next view:

https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://2.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://3.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://4.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

Now you are ready to perform map customizing.
SPRO -- Cross-Application Components -- Processes and Tools for Enterprise Applications -- Visual Business -- Visual Business 2.0 -- Maintain Application Definitions
Step 1 Define Map Product:
 
 
 And assign map tile URL (for better performance used several servers):

Step 2 Define Map Layer Stack:

 And assign Map Product:

 Step 3 Define Application:
 
If you clear all check-boxes, you will get maximum navigation control tools: 
 
 
Assign the Layer Stack:

Having several stacks you can switch between different maps view:


Block 3: Map screens in NWBC
Combinations of applications and screens in NWBC are shown below:

TM_VTC : NWBC -- Planning -- Transportation Cockpit -- Show Map

TM_MDC : NWBC -- Planning -- Transportation Cockpit -- Map (Planning detail quarter)

TM_TNC : NWBC -- Master Data -- Transportation Network  -- Transportation Network Cockpit

GEOMAP_DEMO (web service vbc_geomap_gen2)
 
Block 4: Map providers comparison
There are several map (GIS) providers you can use in SAP and my own opinion about them is expressed below.
 
Google
As I understand, there is no free account to experiment with Google, you must have a Premium account for map display API.
Obtaining an API key:
 
Map tile requests:
 
OpenStreetMap
 
OpenStreetMap (or OSM) it's a free GIS provider been developing by volunteers community, but it looks like it attract more consumers than contributors. Any way, OSM has the most detailed maps.

Map tile common URL:
http://a.tile.openstreetmap.org/{LOD}/{X}/{Y}.png
http://b.tile.openstreetmap.org/{LOD}/{X}/{Y}.png
http://c.tile.openstreetmap.org/{LOD}/{X}/{Y}.png

Comparing to HERE there are more details, lots of Points Of Interest (POI) are on the map (the same place Büschstraße 12 Hamburg 20354 as example):


And in OSM house numbers are not only in the center of the city (the same place Panónska cesta 33 Bratislava 851 04 as example):



Bing
Obtaining an API key:
 
Map tile requests:
 
Map tile common URL:
 
Comparing to HERE there are no house numbers (the same place Büschstraße 12 Hamburg 20354 as example):
 
 
Appendix

Steps to change a map tile URL

In order to change map tile URL for an existing map-provider you need to past it in a dedicated SPRO path:
Cross-Application Components -- Processes and Tools for Enterprise Applications -- Visual Business -- Visual Business 2.0 -- Overwrite Map Server Default URLs
 
 
 
 


You can also like other articles:

SAP Transportation Management
ERP -- TM integration by WSRM (without XI / PI)
Handling deadlines (or Dates) in Delivery and Transportation
SAP Transportation Management 9.0 Installation from scratch
Pricing
How to setup Variant Condition (Price Condition, dependent on the configuration).
IDOCs
Self-Billing and Evaluated Receipt Settlement (ERS) - EDI process
How to set up ORDERS, ORDRSP, DESADV, INVOIC IDOCs interchange in the same system
How to setup loopback connection for IDOC and copy characteristics from 300 to 023 class type
IDOC Data Filtering
How to connect two systems for IDOC interaction
Supply Chain Management
First steps to make SCM Deamand Planning working
SCM liveCache Initializing
ERP <--> SCM integration tricks