Skip to content

Commit dc4e47f

Browse files
committed
docs: explain how to detect OpenUI5 vs SAPUI5 via s_ui5-gav
1 parent ffc5c89 commit dc4e47f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • docs/cookbook/device_capabilities

docs/cookbook/device_capabilities/info.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ DATA(gav) = ui5-gav. " group, artifact, version
2222
DATA(theme) = ui5-theme. " e.g. `sap_horizon`
2323
```
2424

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+
:::
47+
2548
#### Focus
2649

2750
For reading the current focus via `client->get( )-s_focus`, see [Focus](../browser_interaction/focus.md).

0 commit comments

Comments
 (0)