Friday, September 15, 2017

How to check ui5 version at runtime, and set UI5 version in launchpad



1. How to check UI5 verison
When the UI5 application is running, enable javascript debugger. Then from debug console, type the variable of 
sap.ui.version
The output is the currently loaded UI5 version

2. How to set HCP launchpad ui5 version
As all UI5 apps run under a fiori launchpad use the same UI5 version configured for the launchpad, so we need to set the correct UI5 version to match the fiori app's UI5 version.

2.1 open SAP Cloud Platform Cockpit admin
2.2 select and goto portal service
2.3 as each launchpad can have its own UI5 version, so select the site and click the pen button to edit
2.4 in the next screen, under "System Settings" there is a "SAPUI5 Version".
2.5 click Edit button to update the UI5 version to the expected value.
2.6 click Action button and select Take Offline
2.7. click top right the round publish icon to publish the site
2.8 open the site again and check the new ui5 version is used

Pay attention when Everyone or Anonymous roles are enabled for the fiori launchpad, when Guest user is used, errors may return due to lack the required permission. The simple way to fix this is remove Everyone or Anonymous role from the site settings.

3. from sap-ui-core.js, search 
sap.ui,{version:
to get the ui5 version

Friday, September 1, 2017

SAP Web IDE note

When creating Fiori project using SAP Web IDE, after deploying the project to fiori launchpad, starting the app from fiori launchpad may not work, and get an error of "Cannot read property 'getResourceBundle' of undefined".

One reason of this error is when creating the project the UI5 version selected from Web IDE may be different (or newer) than the UI5 version available in the deployed fiori launchpad.

The UI5 version set by web IDE is shown below
 

The fiori launch pad UI5 version is at


The web IDE's UI5 version must match or be compatible with fiori launchpad's UI5 version.

By the way, it is much easy to use Layout Editor to manage xml view than code editor.