Skip to Content

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.

To report this post you need to login first.


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

    1. Ivan Femia Post author
      Hi John,

      thanks for your greetings, I really appreciate!

      I haven’t tried any other tool yet, but I want to develop a custom reality browser, just to taste the complexity.

      Does any one want to create a project on Code Exchange about that?


    1. Ivan Femia Post author
      Hi Chris,

      great to see your comment!

      Sergio Ferrari’s lab team and I are always on the Edge and with great passion we carry on this experiments. 😀

      I happy that the community is giving us a great feedback, this is my happiness 😀

      CU on next blog


        1. Ivan Femia Post author

          not sure I get your question, btw I’ll try..

          OnInitialization BSP Event, I generate the JSON string then I encode it with a simple:

          call function ‘SCMS_STRING_TO_XSTRING’
              text     = lv_hotspots_str
              mimetype = ‘application/json’
              buffer   = lv_hotspots
              failed   = 1
              others   = 2.

          lv_hotspots contains the data to be associated to the BPS response.


          1. Chris Paine
            Hi Ivan,

            sorry, I have phrased my question badly,
            what code did you use to generate your JSON strings from the ABAP data?

            There seems to be at least three libs/methods published that I can find:
            –  json4abap, ZJSON, smartJSON
            What did you use?



Leave a Reply