on 11-20-2016 11:44 AM
If you use build.me or look at https://experience.sap.com/fiori-design-web/ui-components/analytical-card/ 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:
https://sapui5.netweaver.ondemand.com/#docs/guide/0d6c1d5f9e1e4aab950f7b528c59fa5d.html
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,
Matt
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 (!):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt, Re Question 1... my understanding is that ABAP CDS currently supports more annotations than HANA CDS ...
https://help.sap.com/abapdocu_750/en/abencds_annotations_sap.htm
Rgds,
Jocelyn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
Cheers,
Matt
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
https://blogs.sap.com/2014/10/10/abap-news-for-740-sp08-abap-core-data-services-cds/
There's also a wiki on CDS: https://wiki.scn.sap.com/wiki/display/ABAP/CDS+-+Core+Data+Services
Also if you feel like blogging on your OVP experiences we have a collaborative wiki for Fiori Elements at: https://wiki.scn.sap.com/wiki/display/Fiori/Fiori+Elements
Cheers
Jocelyn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.