Custom SDK data source to get map extensions up and running in no time
It is about six weeks now that SAP released Design Studio 1.4 and herewith I would like to share my first experiences with the data source SDK. I was already in the process of thinking of workarounds to become independent of SAP backend systems for offline demo purposes. On that matter SAP made me huge gift for Christmas so to speak.
From the start of the maps extension development process, I wanted test and debug data that could easily be manipulated without switching to any Bex tools or SAP BW. The data source SDK is our chance to do that.
To get the relevant data from the backend system to initialize my first custom data source, I loaded a dashboard containing one of the ConVista maps extensions, the desired data source and finally used SAP scripting language to export the data into CSV (APPLICATION.export(ExportType.CSV)). Some minor cleaning later I had my first custom data source on display with a simple cross tab (find the simple cross tab in the SAP SDK examples).
Figure 1: simple cross tab with custom data source
To mimic the expected structure for the maps extensions some more research need to be done. Therefore I used the browser developer tools to learn the actual structure of the JSON which the Design Studio framework sends to the maps extensions during run time. In particular I focused on the JSON arrays:
- dimensions (holds descriptive metadata about rows and columns),
- data and
Figure 2: OpenStreetMap using custom data source
The SAP example CSV data source serves as a basis for my own data source. I modified the defineDimensions function in the init block and loaded the tuples and the actual data array from an external JSON file. Unfortunately further metadata reduction was necessary because of a jetty form size restriction of 200,000. It is possible to change that parameter but keeping in mind that using the data source should be as easy as possible, this wasn’t the right way to go.
As a result you can now run the ConVista maps extensions in combination with my mapsexampledatasource out of the box without any SAP backend system attached. Find the data source in my GitHub repository:
Me and ConVista love the easy integration and the possibility to get an even quicker hands-on.