Skip to Content

Add Custom SAPUI5 Library to SAP Cloud Platform Fiori Launchpad (Portal Service)

I've created a custom SAPUI5 library with the SAP Web IDE and deployed the library to the SAP Cloud Platform. The library is used by multiple SAPUI5 applications and works perfect when the apps are launched from the SAP Web IDE. The dependency to the library is defined in the manifest.json:

"dependencies": {"libs": {"custom.library"}: {}}}

Now I've registered the SAPUI5 applications to the SAP Cloud Platform Fiori Launchpad. I can start the Launchpad and see the tiles for the apps. But when I start an app the following error occurs:
Error: failed to load 'custom/library/library.js' from https://sapui5.hana.ondemand.com/1.52.17/resources/custom/library/library.js: 404

How can I register the custom UI5 library to the Fiori Launchpad?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Dec 10, 2018 at 10:08 AM

    Bumping this up as I have the same problem.... we run 3 scenarios, hybrid package / desktop / cloud.

    On hybrid package and desktop we just register the libraries in the index.html like this:

    jQuery.sap.registerModulePath("mylibrary.global", "../../../../sap/zmylibrary/global");

    require("mylibrary.global.myfunction") result in this url:

    https://hostname:1490/sap/bc/ui5_ui5/sap/mylibrary/global/myfunction.js

    BUT in the portal we don't have access to the index.html... the alternative would be to write in every app something like

    jQuery.sap.registerModulePath("mylibrary", "https://mylibrary-account.dispatcher.hana.ondemand.com") which is the HCP address of the deployed library, and testing if we are running on the portal - but it is ugly and really dont look future-proof to me.

    The ideal thing would be to have a portal settings where I can map a library to hcp application, like a system-wide neo-app.json

    Add comment
    10|10000 characters needed characters exceeded