Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
maheshpalavalli
Active Contributor
Hi All,

This blog is my journey towards solving an issue and learning how the launchpad plugins are loaded from the backend to the launchpad.

 

->>>Note<<<- This blog won’t explain how to create the plugins in Fiori Launchpad.

For actual help and blogs on how to do it:

https://help.sap.com/viewer/a7b390faab1140c087b8926571e942b7/7.51.3/en-US/a90ed59d22bb46898a2ec7a7da...

https://blogs.sap.com/2017/10/12/create-a-welcome-popup-for-portal-fiori-launchpad-and-freestyle-sit...

https://blogs.sap.com/2017/05/24/allow-users-to-switch-language-in-the-fiori-launchpad-using-ui-plug...

 

Overview:

Fiori Launchpad plugins are used to extend the launchpad functionality like adding buttons and doing some task when the launchpad is opened etc.,

This usually will be done by create a custom ui5 app based launchpad plugin and deploying it to the ABAP server. Then creating the target mapping and assign the role to that catalog and the same to the user.

 

So recently there was a question in answers.sap.com on how to show the outage message for the Fiori Launchpad. I never tried it, so I thought to try it once as it will be a good learning for me.

Now when I did all the coding and configuration, it didn’t work!!. I couldn’t find the plugin loaded in the launchpad. So I thought let’s debug in the old fashioned way(thinking it will be a very easy task :D)

 

So I did f12 on the Fiori Launchpad and started looking at the Launchpad related libraries in the sources and found the below ui2/ushell folder:



So the plugins will be instantiated(see above)

/sap/bc/ui5_ui5/ui2/ushell/resources/~20180316143600~/sap/ushell/services/PluginManager-dbg.js
sap.ushell.Container.getService("Ui5ComponentLoader").createComponent(oApplicationProperties)
.done(function(oLoadedComponent) {
if (oPluginDeferred) {
oPluginDeferred.resolve();
}
oDeferred.resolve.apply(this, arguments);
})
.fail(getRejectHandler());

The above code basically creates the component for the custom plugins(as they are obviously an UI5 app) which is mentioned in the target mappings.

I found here that my plugin component is not called at all.

I checked if any service call might be there to fetch all the custom plugin details but to my surprise no call went to the backend (it makes sense as unnecessary calls will slow down the the Launchpad)

So I debugged a bit and found the code where it is reading the plugins



It is reading from the window parameter "sap-ushell-config" where the plugin details are stored.

So again I started to search where the window parameter is set and found the place, it is nothing but the main flp file where the Launchpad is loaded:



But where is that oServerSideConfig coming from? same file, little bit above, we cannot see it in the debugging as it is a dynamic parameter, so opened it in the backend code directly(below);



So the serversideconfig is set via the placeholder( ${SERVER-SIDE-CONFIG} ) which is again set from http_hanlder class.

Now I went to the HTTP handler class from FLP’s SICF node.



So at last I found the code where it is fetching the plugins.



and they are setting it at below in the response(which is the Fiori launchpad page).



But little did I know, it is fetching the plugins from SHMA(Shared memory access) and so no actually reading the db and trying to fetch the plugins based on a condition, the plugins are already set to SHMA  instance before in some other code.



I guess, this is to increase the performance of the Fiori Launchpad so no addition logic will be performed to fetch the plugins or other information when we launch the FLP.

Here the table mt_plugin doesn’t have my plugin but it has other plugins.

Again, now I debugged where the shared memory is set. But still I don't know which service or backgroundjob or program will save the plugins to SHMA

So I assumed that it might be set from the Launchpad catalog configuration service when we save the target mapping. Luckily yes and the breakpoint got triggered.



I found the issue now.. Instead of ‘Shell’ I’ve mentioned in the target mappings Semantic object as ‘shell’. Even I didn't get any error while saving(no idea why). A silly mistake 😄

 

So after all this debugging, the issue is a very simple one and from this I understood how the plugins are loaded in Launchpad.

1. First they will be set to SHMA on the save of the target mappings to increase the performance of FLP loading

2. The plugins information along with someother launchpad stuff is converted to string and set to launchpad.

3. These data will be read by the plugin manager.js and the plugins components will be asynchronously loaded.

 

This is a kind of reverse engineering but if  you go from the bottom to top, you get an idea of the process of loading plugins to the launchpad.

 

The architecture and coding is an awesome piece of art written by SAP team and It’s a very good learning for me 🙂

 

Thanks to all who took their time to read this till the end 😄

 

Best Regards
Mahesh
21 Comments
former_member585649
Discoverer
Wow, great blog Mahesh.

I have myself deployed quite a few FLP shell plugins but never got the chance to discover all the stuff you have described. Thanks for sharing all these details.

Regards,

Saurabh
maheshpalavalli
Active Contributor
0 Kudos
Thanks Saurabh.
nabheetscn
Active Contributor
Mahesh great blog. I must say the places where we reverse engineer things via debugging we understand the bigger picture, the design behind it.

Again, well done and keep up the great work

Nabheet
maheshpalavalli
Active Contributor
Thanks nabheet.madan3for the feeback..

True, It also gives us the knowledge to design better in our applications. I feel that this is one way to learn architecture and best practices instead of taking courses :), which is a very hard way ofcourse :D.

BR, Mahesh
sitakant_tripathy2
Active Participant

Good one Mahesh…

got a chance to work on S4 instance for couple of months and utilised some spare time understanding the frameworks around ADT, CDS and Annotations, Custom Business Objects , Custom CDS generator on S4 Cloud and SADL.

Especially, CDS handlers  on the visitor design pattern is an extremely brilliant piece of work to look out for. Wonder who wrote this crazy piece of design ?

Some of them are very basic functionalities wrapped onto layers like Custom Business Objects  when published create table definitions on the backend but looks good in terms of end to end realisation from Gateway service implementation to DDIC API calls.

Most of the available information is around applications and use cases and I guess everybody involved in the development front should invest time to read these framework codes and understand the internal workings at the least on a high level. This simply gives a breadth of thought around building on top of existing rock solid functionality and adds on a different level of cognisance to build neatly stacked applications.

nabheet.madan3 Love ur blogs dude.

Regards,

Sitakant.

 

maheshpalavalli
Active Contributor
0 Kudos

Thanks sitakant.tripathy2,

Loved your comment, its just not a simple comment but it's something with loads of information for me to dig more into the system( especially the CDS).

Yes the more we understand, the better we can improve and implement things!

 

BR, Mahesh

nabheetscn
Active Contributor
0 Kudos
Thanks sitakant.tripathy2.  One small request it will be great if you can share those experiences with the community, i will be really interested in reading them. Looking forward to your first one:)

Nabheet
sitakant_tripathy2
Active Participant
0 Kudos
sure..have lost access to the systems now as I moved to another assignment but will give it a try.

Regards,

Sitakant.
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
Good detective work Mahesh!  And an excellent reminder that when we are talking web, upper/lower case always matters 😉

 
maheshpalavalli
Active Contributor
0 Kudos

? Thanks Jocelyn.. It's one of the common issues that a developer faces when they transitioned from ABAP to UI5

former_member214867
Participant
Great blog Mahesh. Thanks
gill367
Active Contributor
Thanks Mahesh. This was useful. saved me some time in debugging an issue.

Some things have changed in the latest version though but still the abap piece is almost same. On the UI config is read using metatags present in the FLP html.

/sap/ushell/bootstrap/common/common.configure.ushell-dbg.js?eval


 

Regards,

Sarbjeet
Vijay
Active Contributor
Just read this one, as was looking for some plugin issue... Super cool maheshkumar.palavalli !!

You can be a part time detective 😉 ...
maheshpalavalli
Active Contributor
Thanks for the update sarbjeet.singh , looks more interesting now especially the metaTagReader, I will also check it 🙂
maheshpalavalli
Active Contributor
0 Kudos
😄 :D, thanks Vijay..

After your comment, I realized that more than half of my blogs were just written based on the detective(reverse engineering) work 😛  I think, I should write more like these, so atleast I will look more into architecture side of many beautiful processes in SAP.
kunju1991
Participant
Great blog maheshkumar.palavalli . Came across this while trying to fix bug with my FLP plugin, good read to understand the concept of plugin load in FLP.
maheshpalavalli
Active Contributor
0 Kudos
Thank you so much for the feedback kunjshukla  🙂 🙂
0 Kudos

Hi maheshkumar.palavalli ,

I am getting below errors in my Console, can you please suggest what could be going wrong,

  • Failed to load resource: the server responded with a status of 404 ()
  • PageBuildingAdapter: remote catalog service sap/ushell_abap/pbServices/ui2/RemoteCatalogService must be loaded before use. -
  • Failed to load resource: the server responded with a status of 404 ()
  • Failed to load resource: the server responded with a status of 404 ()
  • Failed to load JavaScript resource: sap/ushell/plugins/rta/Component-preload.js - sap.ui.ModuleSystem

Thanks,

Ankit.

0 Kudos
Did you resolve the PageBuildingAdapter error?
0 Kudos
Hi Christian,

 

There were errors in JS Code that was causing the error. It worked after Code rectification.

 

Thanks,

Ankit.
saradsales
Explorer
0 Kudos

Hi Ankit,

What kind of errors did you rectified? I would like to solve the following error:

  • Failed to load JavaScript resource: sap/ushell/plugins/rta/Component-preload.js - sap.ui.ModuleSystem
Labels in this area