Tuesday, March 25, 2014

SAP Lumira Extension: Custom Map of Japan


With this blog post I will build on my SAP Lumira extension of a choropleth map of Japan.

The extension can be downloaded here., and the following blog will cover it's use.

The background to the original extension is covered in my SCN blog

Custom Choropleth Maps with VizPacker

This blog and my extension was featured as a "Cool Example" in the SAP webinar here

SAP Lumira SDK - An Introduction and Cool Examples

My intentions for adding extra features/functionality to this extension is a way to try and build the best map *I* can. Emphasis on the "I" as I can't build the best map ever :) . Also it is a good example for me to learn more about D3 and making the map as user friendly as possible inside SAP Lumira.

A free copy of SAP Lumira can be downloaded from the main Lumira site http://saplumira.com/
I only use the free personal edition and all my examples are built on this free version.

I will be adding blog entries on a regular basis with added features or new ways of implementing the technical code for the map or for different countries.

I will be releasing with an update based on dates and the first of these being the 26th March 2014.

Japan Choropleth Map Update 1 - 26/03/2014

Custom Choropleth Map of Japan.


The main updates to the map for this post is to create a pure choropleth map of Japan and strip out the football references in the SCN blog. Also the method to lookup the prefectures is extended, the first example only used the names found inside the Natural Earth Shapefile to recognise the prefectures. With the first update I have added Kanji, Romaji, ISO-codes, FIPS codes and prefecture numbers as ways to build the choropleth map. These can be selected or changed without reloading the map. I have added Javascript code to auto detect these values to match the prefecture name to the map. These lookup values are also available for download for reference.

Download the code and the lookup table from here

The zip file contains two files,




Close SAP Lumira if it is already running.

Extract the downloaded VizPacker file "viz.ext.japanv1.zip" extension to the "extension" directory as shown in the screenshot



After the extension is extracted there should be the japanv1-bundle.js file in the directory structure as shown below.




Example using the Wikipedia data for the population of Japan by prefecture


Taking the first line of the actual data from the Wikipedia page. As you can see the prefecture name is in Japanese and romaji. My SAP Lumira map extension will be able to use these "Prefectures" and "Japanese" columns as attributes to create the choropleth map. The text file in the download contains all the possible attributes that can be used.

RankPrefecturesJapaneseEstimated
Total
Population
Estimated
Male
Population
Estimated
Female
Population
Annual
Change
(Oct 1, 2010 to
Sep 30, 2011)
Estimated
Population
of Japanese
nationality
Latest
Census
Population
(Oct 1, 2010)
Estimated
Area
(km²)
Population
Density
(/km²)
[3]
Capital
1Tōkyō-to東京都13,195,9746,523,5516,672,42336,58612,869,20513,159,3882,188.676,029.22Shinjuku-ku, Tōkyō-to


Example  using the "Prefectures" column for the prefectures and the measure "Estimated Male Population" to create a map in SAP Lumira.





Using the "Prefecture" attribute from the wikipedia table  (red arrow in the screenshot above) this attribute is in romaji and I have moved the mouse over Tōkyō-to and this is shown in the screen shot too.


Next example using the "Japanese" column for the prefectures and keeping the same measure "Estimated Male Population" to create a map in SAP Lumira.


Exactly the same Lumira chart extension but simply swapping to the "Japanese" attribute from the wikipedia data  (red arrow in the screenshot above) this attribute is in Kanji and I have moved the mouse over 東京都 and this is shown in the screen shot too.



Licensed under the creative commons

Creative Commons License

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.









Sunday, February 16, 2014

A map of old ABAP developers

An example SVG map from my SCN blog.

SCN does not support the interactive nature of SVG.

The map was created with SQL Anywhere and the details can be found in the following blog.

Choropleth maps of @SCNblogs links and crime data using SQL Anywhere
The blog details how this map of bitly clicks was created for the top @SCNblog tweet for January 2014.
"A map of old ABAP developers"   

Saturday, February 23, 2013

Add FREE barcodes to the SAP Latin2 HP printer Driver

Adding Barcodes to HP's SAP postscript device types for Latin 2 support( ISO 8859-2)

After a request for help and successful test from my contact in Poland the following methods were used with an HP printer supporting the Latin 2 standard. This option opens up the possibilities to add barcodes with " Polish, Czech, Slovakian, Hungarian and so on" a quote from the note. Note HP printers are required for the language support as the device types are specifically for these printers. Read the note for the supported HP printers.

SAP note referenced.

*Note 575916 - PostScript device type for ISO 8859-2 (Latin-2) and HP
Two methods are covered, first a linking method where the device type contains all postscript code required to generate the barcode. The first method is standalone and requires no additional config to be used with a postscript printer. The second method introduces the postscript code for the barcode at the time of printing via server side configuration. The second method requires SAP parameter changes and application server restarts to pick up this configuration.

1) Linking Method 

The following demonstrates linking the ZI2HPPS printer to the ZBWIPPDM Data Matrix device type. This enables Data Matrix barcodes with Latin 2 languages with Smartforms & SAPscript only. *ABAP list will not work, see the server side method below for ABAP list support. This linking method is standalone and does not require and restarts of the SAP server and can be used as soon as the device types are linked (or imported)


Adapting this method then the other barcode device types I have created can be linked, such as QRcode, Aztec Code etc.

Linking ZBWIPPDM to ZI2HPPS

Download & import ZBWIPPDM from http://bit.ly/sapdatam
Download & import ZI2HPPS from the SAP note 575916
Open Formats for both device types
 
I chose DINA4 in example

Double click on “Printer intialazition” on both


The 5 action pages need to be copies across from ZBWIPPDM to the end of ZI2HPPS printer intialization page.
As shown below


*THIS NEEDS TO BE REPEATED FOR EVERY FORMAT USED IN ZI2HPPS.not just DINA4

COPY ALL PRINT CONTROLS FROM ZBW01 (not shown in screenshot) all the way to ZUP50.


The device type is now ready to be used in SAPscript or SMARTforms.
See the youtube videos for more info on this.
SMARTforms  http://youtu.be/Z1abgzb2ppM

SAPscript http://youtu.be/TraMU7rb7lA

I have created a Datamatrix linked device type ZI2HPPS that can be downloaded here.
The file contains both ZI2HPPS & is linked to ZBWIPPDM and both device types need to be imported.
\BWIPPSAP\LATIN2\linked\ZI2HPPS.PRI
\BWIPPSAP\LATIN2\linked\ZBWIPPDM.PRI



2) Using the BWIPP with the SAP postscript HP device type for latin2 script on the SAP Server Side


This version merges the BWIPP on the SAP server side. By using standard SAP configuration the BWIPP can be merged into the SAP output stream on the server side. The solution is purely postscript based so the barcode solution can be used by ZI2HP to generate the barcodes and latin 2 script.

Steps involved.

1) Download this zip file which contains.
Main directory  BWIPPSAP


LATIN2\serverSide\ZBWIPPI2.PRI This is the SAP device type which contains the BWIPP configuration 
LATIN2\serverSide\Dzbwhp This file is the Barcode Writer in Pure Postscript

SMARTFORMS\z_26barcode.xml Smartform export

PDF_Example\HPi2barcodesPDF.pdf    Barcode only example pdf created with pdfcreator

PDF_Example\Example.png  png image generated with pdfcreator
2) SET the profile parameter 'rspo/devinit/datafile' to
rspo/devinit/datafile =
     /usr/sap/$(SAPSYSTEMNAME)/$(INSTANCE_NAME)/data/D++++++++
Note: Please pay attention to the number of "+" after the letter "D".
*Its important the the parameter is set exactly as above

3) Copy the Dbwipp file to the following directory on the SAP server
/usr/sap/$(SAPSYSTEMNAME)/$(INSTANCE_NAME)/data

*the parameter and Dzbwhp file need to be set/copied to all application servers used for printing.

4) RESTART the application server

5) Follow this original post in regards to a standalone QRcode solution but CHANGE the following steps.
Import device type = ZBWIPPI2.PRI
No ABAP report in this download but a simple smartform based on DINA4 device type format.

6) Start Smartforms transaction and import smartform z_26barcode downloaded earlier.
The smartform is ONLY barcodes and contains no LATIN2 characters. Add these characters before printing on the HP printer. The smartoform can be directly tested by executing the "Test/Execute" button.

The PDF file HPi2barcodesPDF.pdf was created by using the smartform with the ZBWIPPI2 device type with PDFCREATOR frontend printer on windows.

Example.png created again with PDFCREATOR
Click on the image for a better view.




Sunday, November 11, 2012

SAP Visual Intelligence: My entry for the Ultimate Data Geek Challenge

I have entered the SAP Visual Intelligence Data Geek Challenge  Link here

My entry can be found on the Data Geek Wall of Submissions

The submission relates to SDN points and the RSS feeds that I read to gather the data, since the move to Jive the RSS points feeds are no longer available. However as I still have the data I thought it ideal to put through the Visual Intelligence process. The data is available in my trial app on the SAP Netweaver Cloud.

My SDN blog covers the background and inspiration on how I came to collect the data. SDN Blog here.

The full entry on the data geek wall is a 9 minute video covering various aspects such as the year with the most points and top country for average points per contributor.

Here on my blog I have had some fun with my SAPVisi Data Geek entry video by putting it through the iPad iMovie trailer template.


Here is a 1 minute 7 second trailer ( in HD for best viewing.)







Friday, July 20, 2012

iOS: A beginner installs iMAME4ALL on the iPad (with screenshots)


The following is based on the instructions found  here to install iMAME4all on a NON jailbroken iOS device. I have installed on iPad 2 and iPod touch. (although my iPod touch is over 3 years old and not really up to running the code, however iPad 2 runs without issues).



As I have never developed an iOS application before I thought I would document my approach to installing iMAME4all on my iPad and Ipod touch. As I will be installing other projects onto my iPad I will cover all the obstacles/issues I had installing the iMAME project for future reference.

First a warning: It will cost money to deploy any native (i.e. objective C code) application onto your own iOS device.

Deploying code to my Android phone (documented here) was all free, however deploying to your own iphone/ipod/ipad will cost you money. How much depends on what you already have.......

Costs
1) A Mac computer is required to develop for the ipad/ipod/iphone. I already have an iMac so that was free ;) for me.
2) Mac OSX Lion is required for iOS devices running 5.1 with xCode. I did pay the upgrade fee for this as another application I use - iMovie -also required Lion as a prerequisite for the latest upgrade. 
3) Apples iOS developer program. To deploy code to your own device! you need to join the apple developer program. I did spend some time trying to find a way to do this for free, however you can run code on a simulator for free but to actually run the code on the device you need to pay apple.

Install Xcode

Install Xcode from the App Store this is straight forward with OSX Lion.




Download the iMAME4all project code

The Xcode project can be downloaded here

*First issue was that the actual code would not open and required adjusting Xcode preferences.
After selecting menu options Xcode->Prefrences I adjusted the following setting.



I was then able to open Xcode iMame4all project

My understanding of the instructions on the iMame4all page meant the following changes were made.

Change header search paths







Change the bundle identifier



The errors that led me to actual pay for a developer program. Note as per the instructions the code is built against the actual device and not the simulator.

Attempting to bypass the code signing and provisioning profiles to get the code onto my iPad/Ipod failed. Some of the errors as below.




I was not part of the iPhone development team and would like to think I am now I have paid Apple to join, although I will only be installing other Xcode projects not available on the App Store.

So a visit to the iOS dev center to get the right to deploy to my own device. The cost to me was 60 pounds for the iOS developer program in the U.K.


Attaching the iPod device and then submit requests for an iOS development certificate.


The iPod traffic icon turn from orange above to green below and then export the developer profile.

2 new keychain entries proving I have the right to deploy to my OWN device.


Building the iMAME project then works and I selected the "Always Allow" option below.



Thursday, March 15, 2012

FREE KML world countries polygon file - admin level 1

Countries of the world KML file, download for free and it can be use for any purpose, the file is a KML polygon file of  the countries in the world in the Natural Earth datasets.

Previous post covered the countries of the world here.

This post covers another Natural Earth dataset for the Admin level 1.

Download moved, now available here at Github 
Download the KML here: WorldPoly Admin 1 file
You can download the file and use it for whatever you want but there maybe errors or mistakes that you need to check yourself.

I generated the file with SAP ABAP which reads the Natural Earth country shapefile in my geoserver in the clouds.

The country ISO codes were used to colour by region  from the UN site here and compared against SAP table T005. The kml file is missing some countries/info such as Somalia land, Western Sahara as these are missing in the natural earth dataset I am using.

*The Natural Earth Dataset has French Guiana  with the ISO code for France. The ABAP code reads the ISO code to determine the colour of the polygon. More thematic mapping to come.

Looks  like this in Google Earth


Admin Level one details showing where I live.......

Thursday, March 8, 2012

Lifetime of SAP Community Network #SCN points

Recently the all time leader in SCN points changed.

A snapshot of the current leaderboard is below from 8th March 2012

The live rss feed can be found here...

Gordon Du is now the lifetime points leader with an impressive 61815 points (at 08/12/2012).

Marking this change and the soon to be new SCN I have captured the point leaders of all countries in the #SCN world and put the business cards on a map, below is a screen shot of the results in Google Earth.

The KML file is best viewed in Google Earth here.







The KML was generated with the ABAP code found on my SCN blog thematic mapping SCN points 




The KML is best viewed in Google Earth however the KML file in Google maps is below.



View Larger Map

Google +