Show TOC

Including SAP NetWeaver User Interface Services ScriptsLocate this document in the navigation structure

The page builder needs to load a bundle of JavaScript files provided by SAP NetWeaver user interface services.

One of the tasks of the shell.js script is to retrieve the user settings from the ABAP system and apply them to SAPUI5. The script can only perform this task if it is included in the HTML file before the SAPUI5 bootstrap.

<script src="/sap/public/bc/ui2/shell-api/sap/ui2/shell/shell.js"></script>

All other scripts can be required using jQuery.sap.require. You only need to require the scripts that your code uses directly. It is usually sufficient to require factory.js.

Additionally, your page builder has to require all scripts related to contracts (sap.ui2.srvc.contracts.*). This is done in the main() function.

Caution Including shell.js automatically performs domain relaxation in the same way as Web Dynpro, and you cannot influence its behavior.
Note Including shell.js automatically transports user settings such as theme, language, and RTL settings to SAPUI5. For this to take effect correctly, you must include shell.js before the SAPUI5 bootstrap. This has the following consequences:
  • You must not refer to SAPUI5 libraries other than sap.ui.core until the SAPUI5 core is initialized. Use sap.ui.getCore().attachInit() or an equivalent (for example <script id="sap-ui-bootstrap" data-sap-ui-evt-oninit="..." ...></script>).
  • You cannot include style sheets directly from the HTML page in order to override SAPUI5 style classes. You can use jQuery.sap.includeStyleSheet() instead.