Skip to Content

Overview Page - Analytical card "Units" for Overview Page with XSOData - What am I missing?

If you use or look at for what an Analytical Card header can look like; it would seem you can display a KPI with it's respective unit. Also, looking at the UI5 help, it seems to get this unit, you can either add this semantic info to the metadata, or add it as an annotation:

This leads to a series of questions; which all comes down to: "How to I get the unit next to the KPI" (the EUR below)...

Question 1: When I add the semantic "amount with unit of measure" to my HANA Calculation view, the associated XSOData service metadata (which has ODATA4SAP annotations added); doesn't add the sap:unit="{reference UoM Property}" annotation. Is this not supported like this?

Question 2: Assuming I don't add the sap:unit annotation, the annotation modeler on WebIDE doesn't seem to support adding the Units manually. Is this a bug, or can I only do this by adding the annotation manually?

Question 3: If I manually add the annotation to the metadata in the localservice within the WebIDE project, I can then create the annotation; but running this with mock data still shows no Unit of Measure. What precisely is needed to get the UoM showing in the analytical card KPI area?

Thanks for any help you can provide,


Add a comment
10|10000 characters needed characters exceeded

  • BTW - Looking at the actual code which gets the Unit, the following is returning null for path:

    if (oEntityTypeProperty["Org.OData.Measures.V1.Unit"]) {
    var oUnit = oEntityTypeProperty["Org.OData.Measures.V1.Unit"];
    // This is the line which is null
    if (oUnit.Path) {
    	result = result + " {path: '" + oUnit.Path + "'}";
    } else if (oUnit.String) {
    	result = result + " " + oUnit.String;
  • Quick update, I've got the Unit of Measure displaying if I manually add the Path to the Annotation.xml file (as opposed to through the annotation modeler which adds the "Unit" annotation, but not the Path). However this only works in mock up mode where it's using my manually edited metadata file.

    In other words, if I can get the semantic definition added to the XSOData Metadata file, then I can manually get this working by updating the annotation file outside of the annotation modeler.

  • As pointed out on Twitter by Jocelyn Dart (thanks Jocelyn), the above example actually shows a currency (and not an amount with unit of measure); but my question is focused on Unit of Measure scenarios.

Related questions

3 Answers

  • Best Answer
    Posted on Nov 20, 2016 at 11:56 PM

    So figured out how to get this working for XSOData but not sure how to make it work with annotations alone if you haven't added the semantic info to your metadata (which is okay for me at the moment but may be an issue if I want to do a Card for a Gateway odata service).

    In the calculation view on HANA, you need to add the following semantics to your columns:

    Note - Unfortunately, it doesn't look like Overview Cards support fixed unit of measures, hence the calculated column for UoM which also needs the semantic "Unit of Measure" added. Note - Because I tried a fixed constant first, I ran into heaps of trouble with the HANA WebIDE not taking my changes which is why it didn't work.

    BTW - Not sure why I can't add Quantity with Unit of Measure to Counter (a count measure)...but another calculated field would solve that for me.

    With this information in place, you don't actually need to annotate this field at all, and you'll find your KPI tile displays with units (!):

    capture.jpg (36.7 kB)
    capture.jpg (20.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2016 at 11:23 PM

    Hi Matt, Re Question 1... my understanding is that ABAP CDS currently supports more annotations than HANA CDS ...



    Add a comment
    10|10000 characters needed characters exceeded

    • Thanks Jocelyn. Definitely seeing the investment in CDS taking over from everything else for Fiori Elements (including Gateway and XSOData services) - Shame really since so many of us are stuck with ERP and HANA without these features for quite some time yet.

      At least with XSOData I could get this working as expected (was worried there for a bit).



  • Posted on Nov 21, 2016 at 03:50 AM

    Hi Matt

    Very glad you worked it out.

    You are quite right re the investment needed in CDS ... not just Fiori Elements but all the Fiori frameworks are basing themselves on CDS

    Just noting that ABAP CDS is available from NetWeaver 7.40 Sp5 which does still cover many customers on ERP or Suite on HANA. It's always worth checking your NetWeaver release/sp

    There's also a wiki on CDS:

    Also if you feel like blogging on your OVP experiences we have a collaborative wiki for Fiori Elements at:



    Add a comment
    10|10000 characters needed characters exceeded

    • Thanks Jocelyn. Note - CDS is a thing since 7.40 SP5, but OData enablement comes much later (especially if you want annotations) - Not sure what version it becomes usable as a datasource - or whether SAP will invest in CDS on HANA to allow exposing Calculation Views via CDS (currently very limited functionality on HANA from my research related to creating new CDS tables from what I can tell).

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.