Dynamic SAP Fiori Tiles using variants in SAP S/4HANA 1909
It’s been a while since I had the chance to write a blog post about something product related and semi-technical so it’s good to be able to squeeze this in before the end of the year and as an added bonus it’s my first blog post as an SAP Employee!
If you’ve used SAP S/4HANA you will probably already know about some of the neat features that allow users to personalize their experience. In case you haven’t or you need a reminder, I will start with a brief description of them so that we are all on the same page.
Creating views (a.k.a. variants, I use the two interchangeably in this post) for example for List Reports. This allows you as a user to save a set of filters for the list report so that you can quickly apply the same filter in the future. You can even share your views by making them public so that other people can use them too.
In addition you can also save the view as a tile and add it to your SAP Fiori Launchpad, this will create a tile for you in your Home group, with a counter showing you the number of results that match your filter criteria. When you click on this tile the List Report will open with the filter already applied.
These two neat features in effect let you set up smart shortcuts on your homepage that let you quickly see if something needs your attention and then drill down to do something about it. Good old “Insight to Action” in full effect 😉
Recently I was asked if it was possible as an administrator to do the same thing and add these tiles to catalogs and groups so that they could be pushed out to users via their roles? This is a good question… after a bit of pondering, digging around and hints from my colleague Jocelyn Dart I worked out how to do this and thought I’d share it with you in this post as I think it is something that will be useful during all SAP S/4HANA implementations*.
So to give this a bit more context and start with the end in mind I will explain the scenario in a bit more detail. Imagine for a moment that you are a Maintenance Planner and in your role you would like to be able to quickly see how many “High” and “Very High” priority maintenance notifications there currently are for you.
One way to do this is to launch the SAP Fiori Elements based List Report app Find Maintenance Notifications from your SAP Fiori Launchpad and create a couple of variants, one for Priority = 1 (Very High) and one for Priority = 2 (High), you can then save each of those as a tile that will display on your home page. Of course you realise that these tiles would also be really useful for your fellow planners, wouldn’t it be cool if they were just available to you and all your colleagues by default…
So now to the guts of this blog post, as an Administrator you can now make this a reality, thanks to a feature in SAPUI5 for Managing Variants. Here are the steps you need to do:
Go into your own SAP Fiori Launchpad and start the application (you will need to make sure you are assigned the same app as will be used by the end users), in this case it is the Find Maintenance Notifications app. These same steps should work for any SAP Fiori Elements based List Report or Analytical List page.
Create the variants/views you want by setting the filters (in this case I have set Priority = 1 (Very High) and then saving them.
Make sure you save them as “Public” and set them to “Apply Automatically”
To get the Variant IDs that you will need later on you can use the Developer Console in your browser, when you save the view/variant you will see a request to /sap/bc/lrep/variants and in the response body you will see the variant ID
Next save your views as tiles by clicking on the Share icon and choosing “Save as Tile”.
When you navigate back to your SAP Fiori Launchpad home page you should two new tiles in your Home group.
You will notice that these tiles have a count on them to show the count of maintenance notifications based on the priority filter. Again if you check the network trace in your browser developer tools you should be able to see the HTTP request that makes the call for that count. You can copy that for using later too.
Ok, now so I hope you are still following along (well done if you are) we are nearly done. So armed with the Variant ID and the URL for the count you should go to the SAP Fiori Launchpad Designer, go to the catalog you want to assign the tile to and create a new Dynamic Tile (App Launcher Dynamic) you should make sure that the semantic navigation Object and Action parameters match the original tile for the launching the app – in my example below this is MaintenanceNotification-displayFactSheetDemo.
Then go ahead and insert the Variant ID and URL as shown below. The URL parameter used to pass the variant ID is sap-ui-fe-variant-id so it will look something like this sap-ui-fe-variant-id=<insert your variant ID>.
For the URL you can make it relative, something like this
That’s it, if you log on as a user who has the role with the new tiles you’ve just created they should be able to see the dynamic tiles showing the count and when you click them it should launch the Find Maintenance Notifications app and automatically apply the filter.
Here’s a little demo
I hope you find this useful, if you have any comments or feedback don’t hesitate to leave a comment below. In the meantime I will see if I can lobby for this to be streamlined and included as a feature request in the standard product (no promises)… if you think this is useful please let me know in the comments below as it will help my case 😉
*Note: you can use this method as of SAP S/4HANA OP 1909 as the ability to pass a variant ID in the URL has been available since SAPUI5 version 1.65.0
Excellent! Something we've needed for a while! Great to see this working in 1909 - and appreciate the tips on finding the variant. Hopefully that part will be made easier over time. Thanks Simon!
I am getting this idea that SAP is planning to create cards(Fiori 3 style) with more information as launchpad tiles using this approach 😀 😀
Hope it will be as simple as I think 🙂
This is really helpful and gives an example of how a company can standardise a EAM Work Management process using tiles on the Fiori Launchpad (Identify, Plan, Schedule, Execute etc).
The icing on the cake would be if an administrator can set up these tiles with filters such as Priority, Dates, Statuses, and then a user can further refine the filter by setting their own user defaults in the Fiori Launchpad to localise the filter to the assets that they look after (Work Centers, Plants, Planner groups etc).
PM looks like they haven't released the User Defaults functionality in the FLP yet, but hopefully in coming S/4 versions they will.
Great post and much needed one.
This is really helpful. Can we also do something similar for KPI tiles?
I sort of got the KPI tiles working. put the eval id and app state from the kpi url in the param list such as EvaluationId=E.1626696xxxxxx&/sap-iapp-state=xxxxxxx.... and make sure the semantic object and action match the ones used in the original kpi.
The odata URL for the data url should match the url (relative) used by the kpi to fetch the count on the original tile found in dev tools network tab.
One thing missing is the refresh button the KPIs have. Anyone know how to show that?
Excellent. Thanks for sharing
Excellent doc ..thanks for sharing
Hi Simon, thanks for sharing..!!
This feature to share the variants for filters as role based access is requested in most of S/4HANA Project implementations across functions and thanks for making this real, Simon.
Thanks for sharing this really nice blog.
If you could please help me with an issue I am facing. I am trying to do a cross app navigation and want to navigate to this particular variant. Please note that this variant is not set as default one for the user. So, instead of opening the passed variant, the app opens up with the default variant always. Is there anything additional I need to pass?
Hi Parth Jhalani
It's probably better to ask a question like this in the "Answers" section of the community as you may get more responses than here in the blog section.
Just to confirm that your system meets the minimum requirements e.g. SAPUI5 1.65.0 or higher?
Also, if you check the SAPUI5 documentation you will see that there is another parameter specifically for Filter Bar variants e.g.
Hope this helps,
Thanks for sharing. As you know we are starting to move hard on Fiori and one of the things I have noticed is that if a users saves a variant then creates a tile it is fantastic but if they decide to change the filters in the variant the custom tile still reads the older filters. I am hoping this has been resolved in 1909 so if a user saves a tile to a defined variant and that variant is updated in anyway the tile should read & open the updated variant. Do you know whether this is possible?
Thanks for the nice blog, but could it be that this URL parameter used to pass the variant ID is not always the same parameter for all applications?
I mean in your example you use sap-ui-fe-variant-id, but when I try the same with another fiori application filling in my page ID for this parameter it is not recognised and thus returns to the default screen. This makes me think that this is simply not the correct parameter to pass along?
It's a really nice blog. We are still on SAP Business Suite on HANA ECC 6 EHP7 with SAP Business Client 7.0 PL13. We haven't started using Fiori Launchpad yet. Most of our transactions are SAP GUI for HTML Personas transactions and few SAP GUI for Windows transactions. We may want to use Fiori Launchpad (Fiori 2.0) in Business Client as end user entry point to manage these transactions/apps. The feature to save the view as a new tile by end users themselves seems really interesting. Can this feature be used for SAP GUI for HTML transactions? Some users saved multiple selection variants for different purposes and they want to have different tiles on home page for different variants.
Thank you very much.
Thanks for posting this blog. Can we follow this approach while saving tile in Query Brwoser too? I want to configure a tile in Query browser and assign it at the catalog level. But this approach doesn't seem to be working there. Can you please confirm
Hi Simon Kemp this blog is really helpful, can we implement variant using CDS annotations?
Can we able to do for Custom Analytic Query tile also in same way?
I need to share the tiles within the team.
Hi Simon Kemp
Is this method specific to Fiori Elements based applications? When I tried the same for standard freestyle apps, it didn't work as expected.