|
1 | 1 | --- |
2 | 2 | outline: [2, 4] |
3 | 3 | --- |
4 | | -# UI5 Bootstrapping |
| 4 | +# Bootstrapping |
| 5 | + |
| 6 | +Bootstrapping is the process of loading the UI5 runtime into the browser. abap2UI5 generates a `<script src="…/sap-ui-core.js">` tag in the page `<head>`; the URL decides which UI5 version is loaded, from which delivery channel (CDN or your own server) and whether the cache-buster is active. |
| 7 | + |
| 8 | +## Pick a Bootstrap Source |
5 | 9 |
|
6 | | -To pick the source for bootstrapping UI5: |
7 | 10 | ```abap |
8 | 11 | METHOD z2ui5_if_exit~set_config_http_get. |
9 | 12 |
|
10 | 13 | cs_config-src = `https://ui5.sap.com/1.116.0/resources/sap-ui-core.js`. |
11 | 14 |
|
12 | 15 | ENDMETHOD. |
13 | 16 | ``` |
14 | | -See the bootstrapping variants and SAP limitations, documented in the [SAP UI5 docs](https://sapui5.hana.ondemand.com/#/topic/2d3eb2f322ea4a82983c1c62a33ec4ae). |
| 17 | + |
| 18 | +Without an override, abap2UI5 uses the OpenUI5 cache-buster URL — i.e. the latest stable OpenUI5 build. |
| 19 | + |
| 20 | +## Common Sources |
| 21 | + |
| 22 | +| URL | When to use it | |
| 23 | +|---------------------------------------------------------------------------|----------------| |
| 24 | +| `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` | OpenUI5 latest, cache-buster enabled — the abap2UI5 default | |
| 25 | +| `https://sdk.openui5.org/1.120.0/resources/sap-ui-core.js` | OpenUI5, pinned version | |
| 26 | +| `https://ui5.sap.com/resources/sap-ui-core.js` | SAPUI5 latest | |
| 27 | +| `https://ui5.sap.com/1.120.0/resources/sap-ui-core.js` | SAPUI5, pinned version | |
| 28 | +| `https://sapui5.hana.ondemand.com/1.120.0/resources/sap-ui-core.js` | SAPUI5 legacy host name (still works, but `ui5.sap.com` is the preferred alias) | |
| 29 | +| `/sap/public/bc/ui5_ui5/resources/sap-ui-core.js` | Locally hosted UI5 on the same SAP system | |
| 30 | + |
| 31 | +### OpenUI5 vs SAPUI5 |
| 32 | + |
| 33 | +- **OpenUI5** (`sdk.openui5.org`) is the Apache-licensed open-source subset of UI5. It contains all libraries a typical abap2UI5 app uses: `sap.m`, `sap.ui.core`, `sap.ui.layout`, `sap.ui.table`, `sap.ui.unified`, `sap.uxap`, `sap.f`, `sap.tnt`, `sap.viz`. |
| 34 | +- **SAPUI5** (`ui5.sap.com`) is the SAP-licensed superset. It adds e.g. `sap.ui.comp` (Smart Controls, `ValueHelpDialog`), `sap.suite.ui.commons`, `sap.ui.generic.app` and the Fiori Elements floorplans. |
| 35 | + |
| 36 | +If you only need controls available in OpenUI5 — which covers the vast majority of abap2UI5 apps — stick with `sdk.openui5.org`. Switch to `ui5.sap.com` only when you genuinely need a `sap.ui.comp.*` control or a SAPUI5-only library. |
| 37 | + |
| 38 | +### Pinning a Version |
| 39 | + |
| 40 | +Hard-coding a version (`/1.116.0/`) keeps your app stable when SAP ships a new patch. Without a version the CDN serves the current "evergreen" release, which is convenient but can break the app the next time SAP rolls out a change. For productive apps, pin the version explicitly. |
| 41 | + |
| 42 | +### Cache-Buster |
| 43 | + |
| 44 | +URLs containing `sap-ui-cachebuster` append a versioned token to every asset URL, so the browser cache is invalidated automatically whenever SAP releases a new build. Use it when you intentionally stay on the latest release. |
| 45 | + |
| 46 | +### Local Hosting |
| 47 | + |
| 48 | +If your gateway has the UI5 ABAP repository (`/sap/public/bc/ui5_ui5/resources/`) installed, you can serve UI5 from your own SAP system instead of a CDN. This is faster on the intranet, works offline and avoids any external dependency, but you need a basis admin to keep the UI5 version current. See [UI5 Version](/configuration/ui5_versions) for the available approaches. |
| 49 | + |
| 50 | +## See Also |
| 51 | + |
| 52 | +- Official SAP documentation on [bootstrapping variants](https://sapui5.hana.ondemand.com/#/topic/2d3eb2f322ea4a82983c1c62a33ec4ae) and [the supported tags](https://sapui5.hana.ondemand.com/#/topic/91f2cebe7c8e4d289fd80a4f0c0bd2ca). |
| 53 | +- [Bootstrap Attributes](/configuration/setup/bootstrap_attributes) — how to add extra `data-sap-ui-*` parameters next to `src`. |
0 commit comments