0

In sapui5 fiori documentation mentioned that there are several no of 3rd patry libraries are pre-included.

enter image description here

So I need to include this Xlsx library in to my sapui5 html5 application. What is the correct way of including these 3rd party libraries? (Both pre-included & not)

tarzanbappa
  • 4,930
  • 22
  • 75
  • 117

1 Answers1

0

Libraries that are already shipped together with UI5, like mentioned in your question, are already “there” on the server and just need to be required/loaded (“sap.ui.require”) like any other UI5 module. Please see also the official SAP docu.

However, I have not found that particular library in the UI5 runtime bundle. So maybe it is only used by UI5, but not really shipped with it, and needs to be downloaded separately or obtained using npm and put on the server together with the app. From there it can again be required like a regular UI5 module. Or it could be used from an external web server, e.g. a CDN, if the library is provided like that. Instead of requiring by calling sap.ui.require(…), it can also be loaded just like any other JS file would be loaded in any other web page (with a tag in the HTML page of the app). When an app is run in FLP, however, it is loaded as UI5 component, ignoring the HTML (if there is an HTML file at all), so this would not work.

Do you have the same UI5 version in Web IDE and FLP? Which version is it?

  • Hi, my application ui5 version is 1.56.5 and I coudn't find a way to identify the version of the FLP – tarzanbappa Aug 30 '18 at 08:58
  • And I've tried to add the moment js as mentioned in the above @kunj bihari shukla 's answer. And it's also working perfectly in when run in web ide. but once I deployed it to FLP and register it works only for the first time. When I deploy a release again it won't work.. says `moment is undefined`. Same thing happening to XLSX js also – tarzanbappa Aug 30 '18 at 09:01