Meticulous Investigation in Backend: Restricting Fiori Launchpad (ABAP) theme selection
We had Blue Crystal, Belize, now we have Quartz. What we haven’t until now, 3 Fiori revisions later, is a way to allow only a few selected themes to user choose from. Customers create their themes but are left with two options to restrict theme selection:
- Disable entirely have only a custom one set as default
- Have multiple custom themes, but they have to be displayed alongside all standard ones.
The third option, displaying only customer ones, was not possible… until now.
Post-Mortem Update: If you are on ABAP Platform 2020 FPS01+ and only need to hide SAP themes, you can use a new Launchpad parameter THEMING_HIDE_SAP_THEMES for that. Kudos to Séverin de BEAULIEU .
Disclaimer: This is a about an enhancement in INTEROP service, the backbone of all data gathered to make Fiori Launchpad work as we know it (tiles, catalogs, and a bunch of other things). Changing that service blindly can screw really good your system Launchpad. Read carefully the instructions or ask for system backup before starting, one of them will surely help you in this journey.
Note: Those steps were initially done on 7.52 (ABAP Trial) and could be exactly replicated on an older system (7.40). Therefore this standard part is somewhat stable and the procedure should be the same or similar for other stack versions. Steps were done through SAPGUI for Java.
How did I find where to enhance?
The same way as any Fiori/UI5 application that you know nothing (Jon Snow): peek network traffic in browser developer console. All modern web applications communicate with one (or multiple) backend endpoint(s), and UI5 is no exception (OData / REST). You can find its name there.
Here we have path /sap/opu/odata/UI2/INTEROP/Themes. Reading a bit more about how developers implement OData services, you’ll find that SEGW projects commonly falls into /opu/odata/sap/ space, so this INTEROP should be a bit special and have a own handler class or, at least, one assigned. You can find it through SICF transaction.
To debug or not to debug?
Not to debug, be clever. And then debug (cleverly).
We have a name, we have search tools, we have the premise that all new code are implemented in classes. Do the math. Open SE84 and search for it.
We have the class: /UI2/CL_EDM_DA_INTEROP_THM_00. You can either read its source code and locate, or help yourself with layer-aware debug.
Enhancement point spotted! Class constructor of class /UI2/CL_EDM_DA_INTEROP_THM_00. Just one implicit enhancement there and job is done.
I could happily finish here but I won’t. Let’s do this enhancement wise, a pluggable one to be quick to adapt whenever SAP decides to change standard code. Normal development would be with a new customer class wrapping company rules to restrict themes, but I did by creating a BAdI definition and calling it there, and only then implementing a customer class. Why? To share it with you!
You can download/install from git repo thalesvb/flponprem-themerestriction and all you need to do is implement a BAdI with your rules, the same way you do for standard code. Whenever SAP changes (or relocates) that code, git repo will (probably) be updated. You fetch that update for your system, and that’s it. No need to manually readapt code on your end.
Now if you’ll just look right here…
Very helpful. Thanks
excellent information @Thales Batista !
What is unfortunate, is that SAP does not offer this as a standard enhancement spot with BAdI to implement (but is this really unusual for SAP?).
Yep, I have that thought as well, that’s why I designed my “final” code as BAdI: it proves that could be delivered as correction note and have correction instructions all the way down to older but still supported versions.
I'm working on a SAP S/4HANA 2021 and there is a standard parameter (no enhancement to use :)).
In transaction /UI2/FLP_SYS_CONF (system-wide) or In transaction /UI2/FLP_CUS_CONF (client-specific) => parameter THEMING_HIDE_SAP_THEMES
I don't know since when this parameter is available, but it does the job!
Good finding! Did a search here and looks that was introduced on ABAP Platform 2020 FPS 01. It does the job hiding SAP themes. I can't argue against this because it is enough for 90%+ of customer base.
Unfortunately I don't see them downporting it, and for me that also works on older releases (Solution Manager) I'm still screwed with enhancements.
Anyway I'll update the blog to mention this parameter. Thank you.
Haha... Love the humour. You should do more blogs!
Thank you. There are three on the last touch ups... actually dusting for more than a year, but they'll have to wait a bit more for the next writing season (north autumn).