Having been through the process of exposing a HANA Calculation View as an OData Service for a Fiori tile to consume.  There are many examples that show some of pieces of this process but I haven’t seen this documented anywhere fully, so I have attempted to captured it below.

1. Create a Calc View to return a single row as is required by the Fiori tiles.

2. Add additional parameters supported by the Fiori Dynamic Tiles

3. Surface Calc View as an OData service

4. Create Fiori Catalogue for the Fiori dynamic tile to reside within

5. Add dynamic tile to Fiori Launchpad

1. Calculation View

The creation of the Calc View is the piece that is more familiar, this will be returning a single row to the Fiori tile so you may need to perform some aggregation and filtering so that you returning the required information.

In this example the Calc View also contains the other Fiori Dynamic Tile Parameters although only the “number” output is mandatory, all others are optional.

CV-Fiori.png

2. Fiori Dynamic Parameters

The required OData structure and parameters are well documented in this HCP link.  SAP HANA Cloud Portal Documentation

3. OData Services


3.1 HANA XS Project

The OData service resides within a XS Project, so you should create that first ensuring the you have the .xsapp and .xsaccess files, with later revisions of HANA this should be created automatically when you create the XS Project.

Follow the excellent step by step instructions here for creating XS Apps, from step 3 through to 6

SAP HANA Cloud Platform

3.2 HANA OData Service

The OData service is very simple in this example, Werner wrote a great Blog on building HANA OData services

REST your Models on SAP HANA XS

The OData service below access the FIORI_LATEST_VALUE CalculationView and exposes this as LatestValue


service  {
   "TimeSeries::FIORI_LATEST_VALUE" as "LatestValue"
   keys generate local "ID"                            
   aggregates always;        
        }



You can check the OData service easily by launching this from HANA Studio, with the Run As, XS Service

Screen Shot 2015-07-28 at 21.38.10.png

This will launch the XML definition of the OData (xsodata) service that has been createdScreen Shot 2015-07-28 at 21.42.40.png

To check the metadata within the OData Service look at the URL in this format

http://ukhana.mo.sap.corp:8001/Ian-Fiori/LatestValue.xsodata/$metadata

Screen Shot 2015-07-29 at 15.47.32.png

Once the service is created the import thing is that it needs to return data is JSON format as this is what Fiori expects, the $format=json parameter does this nicely, as below.  Also using a chrome extension to format the JSON response.

http://ukhana.mo.sap.corp:8001/Ian-Fiori/LatestValue.xsodata/LatestValue/?$select=subtitle,number&$format=json

Screen Shot 2015-07-29 at 15.51.25.png

Creating a new Fiori Catalogue in HANA Studio for your custom tiles to reside within

Screen Shot 2015-07-29 at 15.54.29.png

Screen Shot 2015-07-28 at 17.15.31.png

Using the tile templates makes it easy to create the dynamic tiles

Screen Shot 2015-07-28 at 17.18.08.png

Paste in the OData URL from above into the Service URL field, ensure to have the $select=number&$format=json

Screen Shot 2015-07-29 at 16.02.59.png

The dynamic tile can then be added to the appropriate Fiori Launch Pad through the standard Fiori interface.Screen Shot 2015-07-29 at 16.06.27.png

There seems to be an issue with “Error Failure – Unable to load groups” with HANA Revision 101 and accessing some Fiori Launchpad links.

Screen Shot 2015-07-29 at 16.07.55.png

This link errors for me

http://ukhana.mo.sap.corp:8001/sap/hana/uis/clients/ushell-app/shells/fiori/FioriLaunchpad.html

Where as this link works fine

http://ukhana.mo.sap.corp:8001/sap/hana/uis/clients/ushell-app/shells/fiori/FioriLaunchpad.html?siteId=sap|hana|admin|cockpit|app|cockpit

I hope this helps you if you are creating similar Fiori tiles.

To report this post you need to login first.

5 Comments

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

  1. Michael Eaton

    Hello

    Did you successfully manage to set any other attributes of the tile (other than number)?  I noticed that in your OData URL you’re selecting subtitle and number, yet the screenshot of the tile doesn’t show a subtitle. 


    I can set number, but no other tile attributes.  I’m using revision 102.

    Michael

    (0) 
    1. Ian Henry Post author

      Hi Michael,

      No, I did not manage to get those to display either.

      I did try, but could not figure out why they would not show up.

      I experienced exactly the same behavior.

      (0) 
  2. Hagen Dittmer

    Hi Ian,

    thanks for the write up. Did you make any headway on the ‘Unable to load groups’ problem. I’m trying to set up HANA Fiori (not GW), and unless I give my users the SITE_DESIGNER role, or similar HANA Admin roles, I cannot get any custom tiles available for them to select.If they can get to the admin cockpit, as your images show, then they have administrator rights; but if they arrive at the base fioriLaunchpad.html URL, I get the same as you.

    (0) 
    1. Ian Henry Post author

      Sorry Hagen, I used the workaround I mentioned above, and did not investigate any further.

      It’s potentially related to the security model, but I’m not familiar what roles or rights are needed.  I would suggest logging a support ticket so that this can be tracked and fixed.

      (0) 

Leave a Reply