Skip to Content

Mobile Augmented Reality in SAP

Mobile is getting more and more important in these days and it gives us a new world to explore.




In this blog I will focus on Augmented Reality, but what is it?


Augmented reality (AR) is a term for a live direct or indirect view of a physical real-world environment whose elements are augmented by virtual computer-generated imagery. It is related to a more general concept called mediated reality in which a view of reality is modified (possibly even diminished rather than augmented) by a computer. As a result, the technology functions by enhancing one’s current perception of reality.” (Wikipedia)



Layar is one of the most famous application for iPhone and Android, that gives an exceptional augmented reality experience, and it gives you the opportunity to create your own layer using their APIs.


The interaction between Layar application and your SAP is performed using JSON; Layar point to a public web URL that response with a JSON hotspots list.








This is what I did with our ECC IDES system, Business Partners are displayed in augmented reality, is it cool?


How is it possible?


1. Create Master data


First of all we need to create a Layar Master Data in our system and a report that fill the Layar table reading Business Partner.


I used the Community Project ZGEOCODE by Gregor Wolf to retrieve Latitude and Longitude from and a simple report ZLAYAR_POI_UPDATE that searches for Business Partner and fill Layar table.


Next step is to create a public URL that retrieve the data and generate the JSON response.


2. Create JSON response


I created a function module ZLAYAR_GET_HOTSPOTS that filters the POIs showing them in the search range in the current location and it creates the JSON response using the code provided by the Google Code json2abap.


I had to modify the form write_field_to_json  code in function module Z_JSON_OUT and function module Z_JSON_FORMATER_VALUE and in order to be compliant to the JSON syntax. 


3. Create a public service that returns the JSON response


To create a JSON response we need to create a service that returns a content-type application/json. I have created an empty BSP Application and into the OnInizialization event handler I call the Function Module previously created.


4. Test your service


Before submitting JSON url to Layar service, I tested it using The JSON Validator.




Everything is ok! We can create the layer.


5. Create the layar project


I followed this tutorial on Layar dev site in order to create my layar: First Layar Tutorial – Create a simple layer and with few simple steps my layer is ready.


Development portal gives you the possibility to test the layer before the submission and publication below my integration test.




My layer is ready!

Many other features are available, for example a useful feature is the possibility to associate user actions to the hotspot (call a contact, send an email, etc.).

I hope this could help someone to create a very special business case and share it with the community.

What is still missing to have this application in an Enterprise reality?

Thanks to Sergio Ferrari and Luca Grilli their support.

You must be Logged on to comment or reply to a post.