Skip to content

Commit 7c5bf2e

Browse files
authored
Merge pull request #112 from abap2UI5/claude/laughing-cori-mJTaz
Reorganize UI5 version documentation and add runtime reading guide
2 parents 452f4fb + 05e36fe commit 7c5bf2e

2 files changed

Lines changed: 40 additions & 33 deletions

File tree

docs/configuration/ui5_versions.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,44 @@ UI5 (SAPUI5) is the default version and ships with every ABAP system from a cert
1515
### UI5 2.x
1616
UI5 2.x is the newest version of UI5, with deprecated APIs removed. We test abap2UI5 against this release on every change to stay compatible with upcoming releases.
1717

18+
### Legacy-Free
19+
A dedicated frontend variant based on OpenUI5's legacy-free distribution removes deprecated features such as jQuery dependencies and synchronous APIs, providing a preview of the UI5 2.x API surface. For details, see [UI5 Legacy-Free](../advanced/legacy_free.md).
20+
1821
### Release-Specific
1922
Some controls and properties are only available on specific UI5 releases. The abap2UI5 framework and its samples support many UI5 versions, reducing compatibility issues. But when building your own apps, check compatibility with the UI5 version your system uses.
23+
24+
## Reading the UI5 Version at Runtime
25+
abap2UI5 ships the current frontend state with every roundtrip. Read it from `client->get( )` — no custom control, no extra event needed.
26+
27+
`client->get( )-s_ui5` returns the runtime UI5 framework details — handy for version-dependent branching or for logging which build a user runs on.
28+
29+
```abap
30+
DATA(ui5) = client->get( )-s_ui5.
31+
32+
DATA(version) = ui5-version. " e.g. `1.141.0`
33+
DATA(build_timestamp) = ui5-build_timestamp.
34+
DATA(gav) = ui5-gav. " group, artifact, version
35+
DATA(theme) = ui5-theme. " e.g. `sap_horizon`
36+
```
37+
38+
### OpenUI5 or SAPUI5
39+
The `gav` (group–artifact–version) field tells you which UI5 distribution is loaded: SAPUI5 ships the `com.sap.ui5` modules, OpenUI5 does not. Checking whether `gav` contains `com.sap.ui5` is the same logic the framework itself uses internally to detect the distribution. No custom control and no extra roundtrip are needed — the info is part of every request, so it already works in `check_on_init( )`:
40+
41+
```abap
42+
IF client->check_on_init( ).
43+
44+
DATA(ui5) = client->get( )-s_ui5.
45+
46+
DATA(text) = COND string(
47+
WHEN ui5-gav IS INITIAL THEN |UI5 distribution unknown ({ ui5-version })|
48+
WHEN ui5-gav CS `com.sap.ui5` THEN |SAPUI5 is running ({ ui5-version })|
49+
ELSE |OpenUI5 is running ({ ui5-version })| ).
50+
51+
client->message_box_display( text ).
52+
53+
ENDIF.
54+
```
55+
56+
::: tip
57+
`VersionInfo.load()` can fail on the frontend, leaving `gav` empty. Treat an initial `gav` as *unknown* rather than assuming OpenUI5 — hence the explicit `IS INITIAL` check above.
58+
:::

docs/cookbook/device_capabilities/info.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,7 @@ For reading device information via `client->get( )-s_device`, see [Device Model]
1111

1212
#### UI5
1313

14-
`client->get( )-s_ui5` returns the runtime UI5 framework details — handy for version-dependent branching or for logging which build a user runs on.
15-
16-
```abap
17-
DATA(ui5) = client->get( )-s_ui5.
18-
19-
DATA(version) = ui5-version. " e.g. `1.141.0`
20-
DATA(build_timestamp) = ui5-build_timestamp.
21-
DATA(gav) = ui5-gav. " group, artifact, version
22-
DATA(theme) = ui5-theme. " e.g. `sap_horizon`
23-
```
24-
25-
##### OpenUI5 or SAPUI5
26-
27-
The `gav` (group–artifact–version) field tells you which UI5 [distribution](../../configuration/ui5_versions.md) is loaded: SAPUI5 ships the `com.sap.ui5` modules, OpenUI5 does not. Checking whether `gav` contains `com.sap.ui5` is the same logic the framework itself uses internally to detect the distribution. No custom control and no extra roundtrip are needed — the info is part of every request, so it already works in `check_on_init( )`:
28-
29-
```abap
30-
IF client->check_on_init( ).
31-
32-
DATA(ui5) = client->get( )-s_ui5.
33-
34-
DATA(text) = COND string(
35-
WHEN ui5-gav IS INITIAL THEN |UI5 distribution unknown ({ ui5-version })|
36-
WHEN ui5-gav CS `com.sap.ui5` THEN |SAPUI5 is running ({ ui5-version })|
37-
ELSE |OpenUI5 is running ({ ui5-version })| ).
38-
39-
client->message_box_display( text ).
40-
41-
ENDIF.
42-
```
43-
44-
::: tip
45-
`VersionInfo.load()` can fail on the frontend, leaving `gav` empty. Treat an initial `gav` as *unknown* rather than assuming OpenUI5 — hence the explicit `IS INITIAL` check above.
46-
:::
14+
For reading the runtime UI5 framework details via `client->get( )-s_ui5`, see [UI5 Versions](../../configuration/ui5_versions.md).
4715

4816
#### Focus
4917

0 commit comments

Comments
 (0)