Developing a Shell Plugin for SAP Fiori Launchpad Service on SAP BTP (Multi-Cloud Environment) with SAP Business Application Studio
Developers can extend the functionality of SAP Fiori Launchpad using Shell Plugins. The concept of plugins allows SAP Fiori implementers to hook into the Launchpad Shell and add new elements like menu items, custom footers, header extensions and many more.
In this blog post I will show you how to extend your SAP Fiori Launchpad on SAP BTP (Multi-Cloud Environment) via a HTML5 Application/Shell Plugin managed by SAP BTP (Multi-Cloud Environment).
In this example we will add a button to the SAP Fiori Launchpad header, which opens a pop-up with some basic information.
Following steps are necessary to deploy your shell plugin successfully to SAP BTP (Multi-Cloud Environment).
You can find the Source Code in this GIT Repository.
1. Open the SAP Business Application Studio
Open the SAP Business Application Studio in your SAP BTP (Multi-Cloud Environment) Subaccount.
Create a new Dev Space and select “SAP Fiori” for application type and click on the created item header afterwards.
2. Create the Shell Plugin Project
Select “Create project from template”. Choose “SAP Fiori Freestyle – Project Generator” and confirm with “Next”.
Select “Cloud Foundry” as target running environment and choose “SAPUI5 Application”.
Enter a Project Name and continue with “Next”.
Select “Managed by SAP Cloud Platform” as HTML5 application and enter a service name.
Enter some basic attributes.
Enter a view name.
Create the project and select “Open in New Workspace” afterwards.
3. Modify the created project to use it as a Shell Plugin
Please develop your own custom Shell Plugin code in the component.js file.
For my example you can modify the “init” Method as well as the Method “_getRenderer”.
Please also adjust the “manifest.json” as follows:
4. Build and deploy your Multi Target Application
Right click on “mta.yaml” and select “Build MAT”.
The folder “mta_archives” is created automatically. Please select the .mtar file and select “Deploy MTA Archive”.
Enter the Cloud Foundry endpoint, followed by username and password. Afterwards please select the organization and your space.
5. Check if deployment process was successful
Please go back to the SAP BTP (Multi-Cloud Environment) Cockpit and check if the following was created:
5.1 Service instances in your selected space
6. Assign your Shell Plugin to a SAP Fiori Launchpad
Open your Site-Manager and navigate to the Provider-Manager. Please refresh the “HTML5 Apps” content provider.
Afterwards you can see your Shell Plugin in the “Content-Explorer” and you can add it to your content.
Assign your Shell Plugin to the “Everyone” Role.
Please create a new Website (or choose an existing one).
Open the URL. You will see an additional button in the Shell Header.
I hope this blog post provides the necessary information to develop and deploy your Shell Plugins successful to SAP BTP (Multi-Cloud Environment). Please leave a comment if you have further questions.
If you prefer using Web IDE please check this blog post.
Thank you for posting this. I've been waiting for this feature.
We have followed same steps but couldn't find plugin in content provider.
I have doubt about step 5, destinations in screenshots needs to be created manually or it will be created automatically ?
the destination is created automatically. Did you refresh the HTML5 Content-Provider (Screenshot 2 - Step 6)
yes, I have refreshed HTML5 Content-provider.
Only difference is we are using portal service not Launchapad does that make difference ?
Thank you for your help, our issue is resolved after adding "sap.cloud" in manifest.json.
I was looking for this! Thanks for sharing!
Hi Soeren, Thank you for the information, I am able to follow your blog and implemented successfully. 🙂 Is it possible to explain how do we call a on-prem destination created in the subaccount from this project?
does this help?
This feature was overdue but happy that we got it. Thank you.
Could not get the destinations created even after refreshing the HTML5 content-provider. I am using VSCode instead of BAS.
The deployment went fine (I am even able to access the component.js of the plugin using the approuter URL). What else might have gone wrong?
I am using the Fiori Launchpad inside the 'Portal' service, (not the Fiori Launchpad service). So this does not work on Fiori Launchpad inside the 'Portal' service?
Any idea is welcome, please.
Found the issue. When you develop via BAS, it automatically created the required configuration within the mta.yaml to create SCP destinations to consume the plugin as a content provider.
But if you develop locally, you need to manually create a module within mta.yaml that has all the destinations you require (I copied them from BAS). This module has "no-source: true" parameter so that MBT will not complain while building. I had to upgrade my MBT for this to happen. (Otherwise it always errored out).
Hi Krishna Kishor Kammaje ,
we are trying to run the plugin as part of the fiori portal service, too, and are experiencing some issues with it. We have tried wrapping the plugin in a module like described by you and quite similar to the example service found here: https://github.com/SAP-samples/launchpad-service-samples/blob/main/MyShellPluginProject/mta.yaml
Could you maybe provide some tips or sample code as to how you set up your mta.yaml so that you got the shell plugin to work with the launchpad as part of the portal service?
Thanks Soeren for the great blog. I have added the subheader to the shell header want to display the username and the role name of the user. Any idea on how to retrieve the logged in user from plugin? Thanks.
does this help?
Thanks for the great blog.
There are many cases where we would need a custom app router in the plugin project, like for example activating the Notification Centre, however I can't seem to get the plugin to work if I choose to have a custom app router.
Have you been able to achieve this?
Same problem here. I am struggling to understand of how to integrate a Shell plugin when not using a managed HTML5 repo/managed app router. The manual part just allows to create an App in the Content Manager but no specific Shell-plugin. Integrating a content provider with the html5-rt and html5-dt services is also not working. Any idea of how to achieve this?
I had the same problem, what you can do is create and then deploy a separate ui5 application with settings as managed approuter. In that ui5 application make the changes as motioned above .Then what will happen is once u deploy the application you would get the ui5 plugin appearing in the content explorer. The logic is that a separate application/project deployed with managed app router will have the same launch pad as your existing stand alone approuter project.
I followed all the steps and deploy was also successful, but it is not working and i get the below error in the browser console.
Thanks and Regards,
Please check your manifest.json. It appears that lately, the "sap.cloud.service" property isn't rendered by the template for some reason. The issue went away when I added the value. Note that I believe it needs to be the same value as in the destination.
thank you for this post. Would it be possible that you provide your sample project in a public Git repository? That would help to avoid all the tedious manual steps.
we are working on it. I will inform you here.
you can find the source code in this GIT Repository:
it seems that the "SAP Fiori Freestyle – Project Generator" was changed and creates the parameters for the destination-content module as 'instance'. But for the Launchpad it should be 'subaccount'. Thanks to Holger Schäfer for this tip on Twitter.
Hi Gregor Wolf
do you happen to have also tried running the shell plugin within a launchpad via the portal service? Any parameter that need changing from the sample code provided to get that working?
Thanks for explaining in detail . But now in BAS Trial account SAP Fiori freestyle template now shows deprecated listed here . So now what is the alternative for it as seems this option will be removed as its showing deprecated ?
please use "SAP Fiori application" and select "SAPUI5 freestyle" as Application Type in the next step.
Thanks Soeren for your help .
thanks for the BTP update!
How do you test it locally?
I think BAS misses the localSandbox preview scenario like in NEO.
Since the index.html is not used, i changed it to the follwoing code, the be able to use start script to preview my coding inside SandBox FLP before deploying it to CF.
Using bootstrapPlugins section inside sandbox config auto loads the plugin into the sandbox flp.
Even the services can be used/tested while local previewing it.
Maybe there is a better way of local test/previewing shell plugin, but this one fits my needs.
Maybe these snippets are also quite useful for others...
Intercept Portal Navigation
Thank you Holger!
Hi Holger Schäfer ,
Nice examples to test the app locally. As with the code,
the website (wikipedia) is loading inside Fiori launchpad page using this approach for local Sandbox file. Do you know if it is possible to do this on On-Premise Fiori launchpad. How can I configure a tile/target mapping for an external URL to load the website inside Fiori launchpad?
You forgot a proper ID for this <script> block:
I use this block and it works fine:
Hello Soeren Holst,
I had a requirement where I am fetching a JSON file and displaying it in my FLP using the shell plugin. I tried using the destination( cannot use URL directly to fetch the JSON as cross-site origin error) but the shell plugin was not able to get the destination configured in neo-app.json. Is there a way to fetch my JSON file via a URL, containing a message to be displayed in a popup, via a shell plugin?
Hello Soeren and thanks for the informative post!
I have tried to follow it but I am running into issues when deploying to cloud foundry. I wrote a question about it here, any insights you might be able to provide would be greatly appreciated.
ive implemented this scenario just like your example and it works fine in the beginning. After navigating into a UI5 freestyle application it vanishes. Any ideas?
Thank you in advance,
did you solved that issue?
i didnt change a thing. Maybe a new version solved my issue. I will have a look and reply again.