Additional Blogs by Members
Showing results for 
Search instead for 
Did you mean: 
Former Member
h2. *First a bit of background* I used to live in a place where the streets have no names which is weird or maybe just different depending on your location in the world. As well as "lost in translation" I was just simply lost most of the time.  As a result I found myself interested in geographic information systems (GIS software) as a way to understand more about the place I was living.  I like this video as it covers a "weird or just different" topic with an example based on street names. A TED talk by Mr Sivers, youtube link. Media Description: Link: After searching the web I tried the free open source based DVD ( from the Open Source Geospatial Foundation, that to quote "allows you to try a wide variety of open source geospatial software without installing anything".  Now during this timeline I attended several meetings where people were talking about SAP reports based on postcodes. So I had the idea to combine my interest in GIS software and SAP to see how I could present SAP data on a map. Especially as I also found a geographical database of postcodes available for download here at ( What follows is based on the fact we did have a standalone SAP ERP (640) system and not any other reporting tool at the time. This will be changing for the company I work for. So the following SCN points example was used as a way to learn more about SAP and integrating software and is based on a NetWeaver 7 demo system. A link to the ABAP code used is at the end of the blog. h2. *Presentation of the data on a map* So let's start with an example based on SCN contributors worldwide. Now SCN points may or may not be your reason to be on SDN, and points are not everyone's cup of tea. However below is a map created with the SCN RSS feeds (  in regards to contributors worldwide.  The report is based on points per contributor for 2011 by country in an thematic map. Now I guess you can guess which countries dominate the points, so I chose (because it's my blog 🙂 points per contributor and not put any minimum on the number of contributors. So I say hello and thank you to SCN members in Slovenia and Panama for your contributions. More on this later as it is created in ABAP with the open source GIS software Geoserver providing the KML to process.   While checking the results I did notice an impressive performance in my chosen category of points per contributor from Canada. So..... h3. *The SCN point kings at the SAP Vancouver office.* OK, I do not have detailed information at hand to fully back up this claim however, based on the RSS feeds I "felt the force" and took an assumption Business Objects was the key to the Canada performance. So I ran the report with and with out Business Objects/Crystal Reports. The results, again I am limited in how much I can show in 500x700  image. A couple of clicks later on the RSS stream of the top contributors and the SAP Vancouver office is the place for SCN points. * * h3. {code:html}Example KML in the Google Earth API can be found here{code} The link will only work with Windows or a Mac as the Google Earth API is only compatible with those platforms h2. *Credit where its due* When I first ran the ABAP report I chose total points and a small range of colours and one country stood out in India. Now I am sure there are lots of teams in many office buildings where SCN points are generated at a rate that beats the rest of the world. However I do not have the detailed data to identify any. However the SCN point champions are from India. And I probably didn't need to run any report to figure that one out. h2. *Other* *Examples * The main inspiration for all the ideas for KML came from the Thematic Mapping Engine website. Most if not all the ideas in the following ABAP KML report are based on the information shared at this website. *Thematic Mapping Engine (* Nowadays it appears that most data comes with a map and a couple of examples that I like are here, {code:html}superbowl & beer{code} my interest was beer  as the other aspect of the presentation  reminds me of telling my son there is a real game of football and its not soccer :). {code:html}how to cross Dublin without passing pub{code}.  I am not sure if I could cross any city in the world without passing an Irish pub. I do occasionally check out my youtube video for[ Barcodes in SAP with the Barcode writer in Pure Postscript |] from one of my previous blogs (Barcodes in SAP with the Barcode Writer in Pure Postscript.). It makes me realise the world wide nature of SAP and YouTube (* I presume no one would watch an SAP barcode video unless they really wanted to). The youtube stats use the google charts for their maps. . The URL to generate the chart is below. I won't consider the option to front end this process with ABAP! - I'll stick with KML AAAAAAAACAABACAAAAAAAAABAAAABABAAAAAAAAACAAgAAAAAAAAABAA AAAAAAAAAuAAAAABAAAAAAAAAAA9AAAAAAACAAAEAADAAANAAAEEAAAAA AAFAAAAEFFLAABADAAAAAAAAAACAAAAAAAAAAAAACDAAAAHAAAAAAAAAA FAAAAAAAAAFCAAAAAAAAAAAABAAJAAHAAAADAAAAAEA&chco=f9f9f9,e2eecf ,3eb011,008800&chls=1,0,0&chld=HUILVUMASMAWDDWFSJCZNUKEVCZWBG KPUAKGFIMMADSIASANBYPHMKPKBEDZMDTVMLESKZJEGTSYMOCOPAKNJPHMGR NPSZMGBWBILAATTCNIPTLCROSRFXBSBLAZPYMQTKGLAUDJISLVPRSKCVPEKHZ MVIPNIRKMYULKNTCHAFTLDEPMVESNGIGASCTTUMHREECFFJHTBVCCGDRSBUER GNLIUSCRZRDMSHNCZAGEJMAXYTCYSUFOYEBHGFTGINMWPSPFCDSODOGUQA MCBMCUMYMERWTWMUPWAGKRGHTPSBTHSGFMIQETAMTOTZCIFRNAVAMSCKC LBRSAHKNRGQNZAQRUGYBDCMUGGGLRAIGMLYTJVNSVNOYDEHMVBZNEBFMZRE CNLBMPARCAJOVGBAMFTROMSTLSTFBNIEMHCXEGKYMXIMGSTNNGLTBTIOGPTD NLAEALPGCSMRGWMNBOAOHNSDCGUZSETMKIGBKWBJITLUBBECFKIDDKNFSLMT UYPLWS&chxt=x&chxl=0:|world&chf=bg,s,EAF7FE ! tube test will it work|width=361|src=! h2. *KML * So now with some software and SAP data I needed ideas on how to present the data in SAP on a map. Attempting to keep it free and open source based as I was using open source software.  (The actual presentation ends up with Google Earth or ESRI ArcGis explorer ( so check out the terms of use of those). Back searching the web again and I found a way to present data with KML at the following site Thematic Mapping Engine ( At this point I felt sure there would be some resource on SDN with KML, however I could not find any relevant data/information to use.  I do consider myself pretty good at finding things on the internet, however on this subject (SAP and KML) nothing that matched what I wanted to do. As I will be moving back to place where the streets have names, I will post my attempts at thematic mapping as I certainly enjoyed the process and learnt something along the way.  * Also a very recent tweet in regards to the {code:html}SAP/ Google partnership{code} focusing on Google maps, made me mark it as a favourite tweet. Just as I was about to delete my blog 🙂 I realised the SAP Google partnership is for the business analytics side only so I probably will not get to see it soon, as we do not have that software. Two basic approaches with KML that I covered are detailed in the creative commons document on the thematic mapping website. h3. *Choropleth maps* During the research into choropleth maps I did come across the Esri shapefiles ( which are part of presenting SAP BI data on a map ( However I did not use these files as I found the Natural Earth datasets which are public domain (my examples are based on version 1.3). These shapefiles can be used for any purpose and have polygon shapefiles ideal for choropleth maps.  [Natural Earth Dataset. |]  !|height=72|alt=Natur... Earth Data|width=216|src=! h3. Scalable icons. Now you can put the Google Earth api into SAPGUI for windows and you will have to pay Google for that api. Windows SAPGUI is not really the right tool for the job, however at the time I was trying to present the idea it appeared to be the best option.  As even BSP's at the time were end of life and not even the icf nodes were active on our 640 based system. Google Earth API allows a string ({code:html}parse kml{code}) to be used to provide the KML. Now modifying my favourite ABAP demo program (which I haveused elsewhere (Generating QR codes with a Zebra Crossing in the Java stack)) SAPHTML_DEMO1 with the required javascript then the following demo shows scalable icons and using different icons to display customers by type. The geocoding is done via the postcode only service offered by geonames (  Media Description: Link: h2. *Producing the source Choropleth ( KML* As part of the OSgeo livedvd (mentioned earlier) a java program called Geoserver ( can output KML from shapefiles.  There are a number of ways to get KML from a shapefile but I do like the flexibility of Geoserver and its ability to modify the data with configuration settings/flat files. Another aspect of Geoserver is the great documentation and tutorials available online. The first option is to load the Natural Earth shapefiles into Geoserver and there is a tutorial on this here ( Then taking the KML placemark tutorial ( as an example I placed the ISO country codes I required into a XML markup to be used in the KML.Another tweet that I took notice of was the fact that the entire {code:html}Natural Earth Dataset is available in Google Fusion Tables{code}. I did comment on the Mr Sandvik's blog and he did say the data is available to use, although Google fusion tables terms of use are mentioned. As far as I can tell the service maybe free to use, however the terms of use link is here ( for the api. * * h2. *Into the clouds for free*  [Amazon micro instances |] are available for free for new customers. I always thought about using an Amazon instance for an SAP system but never wanted to pay for the privilege as I had vmware player and virtualboxed SAP systems.  You can't get a SAP system onto a micro instance however you can install Geoserver and many other web services. Another tweet lead me to the clouds and I am hooked, just need now to figure out how to make it pay after the free period expires. Along similar lines of being free and presenting data I was immediately drawn to the blog about the [free download of "SAP Crystal Presentation Design" last year | SAP Crystal Presentation Design ( Xcelsius Present) Free Giveaway!]. The offer has now ended but linked for reference. So checking the program for all things related to maps and Japan, I found the following map for the regions of Japan. So inspired by the presentation from the program (and the Google charts) and my new found knowledge of Geoserver I knew it was possible to generate images and style the map with custom controls via a URL. So here is a PNG image from my cloud based Geoserver where the colours are being defined by the URL call. If you right click on the image you can check out the URL, it's not as complicated as the Google Chart Map mentioned earlier, as the URL only sets the colour of the region. However a URL could be constructed in ABAP to set the colours depending on requirements. Also Geoserver allows other images to be part of the Web Map Service (WMS) call, follow the link to see the details ( I have placed a QRcode in the image below but it could be a legend/title to cover the details of the map. (Here is the {code:html}SCN points example shapefile in openlayers{code} where the legend is created by Geoserver) ! in the cloud|width=512|src=! h2. *Painting By Numbers* Usually the only colour coordination I am interested in is matching my tie to my shirt, and I am not that great at picking out colour combinations. So online tools for map making I came across are. [Colorbrewer |] is an online tool for map colours Also thanks again to the Thematic Mapping Engine ( document in regards to KML and the fact that the RGB colours are actually in BGR order. This allowed me to use the free Google chart tools to produce some titles and legends with some adjustments.

h2. *Scale & Legends and *Normalising Your Data* * KML is not really setup for producing scales and legends. However once again thanks to the thematic mapping engine I used the image overlay to get Google charts onto the map. Also Geoserver has some KML legend graphics ( that can be used for the shapefiles with the static data. Now presenting data on a map can have some issues which I came across during the process of putting this demo together. Normalising and presenting data is covered[ here |] and normalising data is mentioned in the wikepedia entry for choropleth maps ( With the SCN points demo I just went for the data that at least gave me some colours on the map.

h2. *Is French Guiana in Europe and Hello to South Sudan* As master data plays an important role in identifying your data on a map in SAP. I do have to point out some areas of the natural earth dataset that I used. Now French Guiana has the ISO code for France which does put it in Europe in my method of selection (there are other Natural Earth datasets with dependancy ISO codes in the shapefile) . Also South Sudan already exists in the dataset but the ISO code is -99. So I have made other comments in the ABAP source code (see the end of the blog) on other countries where the selection is not a straight forward match. Now there is the possiblility of directly editing the shapefiles to correct/set any data as desired. I did {code:html}this for Japan here{code}, where I added the ISO codes for the prefectures. h2. Closer to Home My original intention in regards to this blog was covering the examples I was doing for Japan. The blog has been in draft for a while. Back in February I was about to start the process and blog about thematic maps which related to Japan. Then on March 11th the earthquake and tsunami struck and while I was not directly affected by these events, my life did change direction as a result. My thoughts are with those still coping with the aftermath and I remain deeply impressed by the way the people coped and are {code:html}rebuilding the nation{code}. h2. Free the Postcode Now I have briefly mentioned master data earlier, as good quality master data will make it easier to produce thematic/choropleth maps. My original method linked the geonames ( Japan postcode data to the prefectures from the Natural Earth dataset. Also using the geonames data for scalable icons as detailed above. Although there is a big hole in the geonames data for Japan ( While in Japan I did come across the "free the postcode" ( website in relation to the data for the UK. Now the data for Great Britain has been freed ( So I downloaded some of the data from the Ordnance Survey website and also from US Census website ( Using the Geonames postcode data for the US and link this to the US Tiger shapefiles for Rhode Island as an example . The Common Query Language ( (and ECQL) can be used with Geoserver to query the attributes of the dataset. So after using QGIS (  to load the Geonames dataset for Rhode Island into a shapefile I was then able to use the data in Geoserver. This is purely for demonstration purposes of linking postcodes to regions. {code:html}{code}Take the County Providence and using the Tiger Shapefile then follow the link to see the {code:html}polygon for Providence in Google Maps.{code} using my Geoserver in the cloud. Another example this time based on the Geonames data for Great Britain matching the Ordnance Survey data. Using the geonames webservice and the post code B91 3TF -[ link | 3TF&maxRows=10&username=demo&style=full] Links nicely to the the ordnance shapefile as shown again in{code:html} Google maps for the Solihull district{code}.  Now onto the actual SCN thematic map code which hopefully shows you how you could create a map with a whole bunch of county or region polygons. h2. Thematic* Map ABAP code with simpl**e transformations* h2. *Back to the Future.* With the arrival of Gateway and the way it opens up SAP data it appears many old blogs of yesteryear have renewed relevance today. The way I started with reading data from an RSS web feed is here in Brian McKellar's 2004 blog (BSP Programming: RSS = HttpClient + XML + XSLT) which refers to a DJ Adams blog from 2003. I adapted the code to use (not so) simple transformations after further reading of the SAP help. Also the forums helped out for some of the code challenges I faced, to many threads to mention them all, but one name Rich Heilman did stand out in many of the answers I chose to use. Now what I have done with the answers and the code is my adaption and any issues or mistakes are obviously mine. And I do point out it is a demo in a demo SAP system and maybe you can help me out. I would like to hear any suggestions on improving the code.

h3. The ABAP source/nugget can be found here. ( The selection screen looks like this. There is a README file in the zip file that covers some of the selection options. h2.   h2. And finally Geoserver can also generate KML with a time series based on static temporal data in a shapefile. Check the documentation here ( So based on SCN Points worldwide from 2004 to 2010 I did follow the document and created a time series for the total SCN points from the RSS feeds. The kml can be found in the ABAP/Nugget zip file link above, also included is the base spreadsheet I used with QGIS and Geoserver to create the static data in the shapefile. The KML time series looks like this, note the time bar across the top of the screenshot.