Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/advanced/fiori.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ sap.ui.core.Component.create({

5. Create abap2UI5 app class

On the ABAP side, the app receives the Fiori startup parameters (like the app class name and any custom key-value pairs) via `client->get( )-t_comp_params`. The `check_initialized` flag — a public `abap_bool` attribute of the app class — ensures the parameters are read only once, on the first roundtrip. Setting `backgrounddesign = 'List'` gives the page a white background matching the Fiori object page:
On the ABAP side, the app receives the Fiori startup parameters (like the app class name and any custom key-value pairs) via `client->get( )-t_comp_params`. The `check_initialized` flag — a protected `abap_bool` attribute of the app class — ensures the parameters are read only once, on the first roundtrip. Setting `backgrounddesign = 'List'` gives the page a white background matching the Fiori object page:
```abap
" class definition:
" PUBLIC SECTION.
" INTERFACES z2ui5_if_app.
" PROTECTED SECTION.
" DATA check_initialized TYPE abap_bool.

METHOD z2ui5_if_app~main.
Expand Down
12 changes: 7 additions & 5 deletions docs/advanced/insights/24-abap-unit-for-a-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ CLASS zcl_app_overdue DEFINITION PUBLIC.
END OF ty_s_invoice.
TYPES ty_t_invoice TYPE STANDARD TABLE OF ty_s_invoice WITH EMPTY KEY.

DATA t_invoices TYPE ty_t_invoice.
DATA t_overdue TYPE ty_t_invoice.
DATA key_date TYPE d.
DATA t_overdue TYPE ty_t_invoice.
DATA key_date TYPE d.

METHODS data_read.
METHODS overdue_calc.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
DATA client TYPE REF TO z2ui5_if_client.
DATA t_invoices TYPE ty_t_invoice.
METHODS view_display.

PRIVATE SECTION.
Expand Down Expand Up @@ -148,7 +148,9 @@ Two habits are worth keeping on purpose, and both are free if you start with
them. Handler methods take their input from attributes rather than from
`client->get( )`, so a test can set the input. And `data_read( )` is its own
method, so a test can either run the real `SELECT` against test data or fill
the table by hand and test the logic alone.
the table by hand and test the logic alone. No view binds `t_invoices`, so it
sits in the protected section; a test that fills it by hand is made a friend
of the class with `LOCAL FRIENDS` in the test include.

The view itself has a different kind of check. The [linter](/advanced/linter)
reconstructs the XML the chain builds and holds it against the UI5 metadata —
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ It needs a real UI5 runtime, so it ships as a second package — one deliberate
install rather than a surprise attached to the first:

```sh
npm install -D @abap2ui5/render-runtime # the UI5 runtime, once
npm install -D @abap2ui5/linter-render # the UI5 runtime, once
npx playwright install chromium # and its browser
```

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/mcp_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ That install is about 45 MB, and 19 MB of it is a Playwright driver only
`run_app` uses — paid on the first start, cached afterwards.

`screenshot_view` additionally needs the linter's render runtime and a browser
— `npm i -D @abap2ui5/render-runtime && npx playwright install chromium` in the
— `npm i -D @abap2ui5/linter-render && npx playwright install chromium` in the
linter checkout. `validate_view`'s property gate needs neither.

### Level 2 — the sample catalogs and deploying (about 110 MB)
Expand Down
7 changes: 4 additions & 3 deletions docs/cookbook/event_navigation/navigation/inner_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ CLASS z2ui5_cl_sample_stack DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA mv_level TYPE i.
DATA mv_note TYPE string.
DATA mv_note TYPE string.

PROTECTED SECTION.
DATA mv_level TYPE i.

PRIVATE SECTION.
ENDCLASS.

Expand All @@ -109,7 +110,7 @@ CLASS z2ui5_cl_sample_stack IMPLEMENTATION.
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`

)->ele( `Page`
)->a( n = `title` v = |Level { mv_level }|
)->a( n = `title` t = |Level { mv_level }|

)->tag( `Text`
)->a( n = `text` v = client->_bind( mv_note )
Expand Down
60 changes: 33 additions & 27 deletions docs/cookbook/expert_more/lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ CLASS z2ui5_cl_sample_lock_1 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.
DATA ernam TYPE vbak-ernam.
DATA erdat TYPE vbak-erdat.
DATA auart TYPE vbak-auart.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA ernam TYPE vbak-ernam.
DATA erdat TYPE vbak-erdat.

METHODS on_init.
METHODS on_event_save.
METHODS view_display.
Expand Down Expand Up @@ -144,7 +145,7 @@ CLASS z2ui5_cl_sample_lock_1 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand All @@ -153,12 +154,12 @@ CLASS z2ui5_cl_sample_lock_1 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Created by`
)->tag( `Input`
)->a( n = `value` v = ernam
)->a( n = `value` t = ernam
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Created on`
)->tag( `Input`
)->a( n = `value` v = CONV string( erdat )
)->a( n = `value` t = CONV string( erdat )
)->a( n = `enabled` b = abap_false
)->tag( `Button`
)->a( n = `text` v = `Save`
Expand Down Expand Up @@ -227,12 +228,13 @@ CLASS z2ui5_cl_sample_lock_2 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.

METHODS on_init.
METHODS on_event_save.
METHODS view_display.
Expand Down Expand Up @@ -327,7 +329,7 @@ CLASS z2ui5_cl_sample_lock_2 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand Down Expand Up @@ -396,15 +398,16 @@ CLASS z2ui5_cl_sample_lock_3 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.

DATA token_aedat TYPE vbak-aedat.
DATA token_aezet TYPE vbak-UPD_TMSTMP.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.

DATA token_aedat TYPE vbak-aedat.
DATA token_aezet TYPE vbak-UPD_TMSTMP.

METHODS on_init.
METHODS on_event_save.
METHODS view_display.
Expand Down Expand Up @@ -498,7 +501,7 @@ CLASS z2ui5_cl_sample_lock_3 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand Down Expand Up @@ -541,15 +544,16 @@ CLASS z2ui5_cl_sample_lock_4 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.

DATA token_aedat TYPE vbak-aedat.
DATA token_aezet TYPE vbak-UPD_TMSTMP.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.

DATA token_aedat TYPE vbak-aedat.
DATA token_aezet TYPE vbak-UPD_TMSTMP.

METHODS on_init.
METHODS on_event_save.
METHODS view_display.
Expand Down Expand Up @@ -672,7 +676,7 @@ CLASS z2ui5_cl_sample_lock_4 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand Down Expand Up @@ -755,12 +759,13 @@ CLASS z2ui5_cl_sample_lock_5 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.

METHODS on_init.
METHODS on_event_save.
METHODS on_event_cancel.
Expand Down Expand Up @@ -893,7 +898,7 @@ CLASS z2ui5_cl_sample_lock_5 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand Down Expand Up @@ -952,15 +957,16 @@ CLASS z2ui5_cl_sample_lock_6 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA auart TYPE vbak-auart.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

DATA vbeln TYPE vbak-vbeln VALUE `0000004711`.
DATA auart TYPE vbak-auart.
DATA locked_by TYPE string.
DATA token_aedat TYPE vbak-aedat.
DATA token_aezet TYPE vbak-UPD_TMSTMP.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

METHODS on_init.
METHODS on_event_save.
METHODS on_event_release.
Expand Down Expand Up @@ -1144,7 +1150,7 @@ CLASS z2ui5_cl_sample_lock_6 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Sales Order`
)->tag( `Input`
)->a( n = `value` v = vbeln
)->a( n = `value` t = vbeln
)->a( n = `enabled` b = abap_false
)->tag( `Label`
)->a( n = `text` v = `Type`
Expand All @@ -1153,7 +1159,7 @@ CLASS z2ui5_cl_sample_lock_6 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Status`
)->tag( `Input`
)->a( n = `value` v = locked_by
)->a( n = `value` t = locked_by
)->a( n = `enabled` b = abap_false
)->tag( `Button`
)->a( n = `text` v = `Save`
Expand Down
19 changes: 11 additions & 8 deletions docs/cookbook/model/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ CLASS z2ui5_cl_smp_app_067 DEFINITION PUBLIC.

PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA amount TYPE p LENGTH 14 DECIMALS 3.
DATA currency TYPE string.
DATA numeric TYPE n LENGTH 12.
DATA check_initialized TYPE abap_bool.
DATA amount TYPE p LENGTH 14 DECIMALS 3.
DATA currency TYPE string.
DATA numeric TYPE n LENGTH 12.

PROTECTED SECTION.
DATA check_initialized TYPE abap_bool.

PRIVATE SECTION.
ENDCLASS.

Expand Down Expand Up @@ -256,8 +257,9 @@ CLASS z2ui5_cl_smp_app_067 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Documentation`
)->tag( `Link`
)->a( n = `text` v = `https://sdk.openui5.org/api/sap.ui.model.type.Currency`
)->a( n = `href` v = `https://sdk.openui5.org/api/sap.ui.model.type.Currency`
)->a( n = `text` v = `https://sdk.openui5.org/api/sap.ui.model.type.Currency`
)->a( n = `href` v = `https://sdk.openui5.org/api/sap.ui.model.type.Currency`
)->a( n = `target` v = `_blank`

)->tag( `Label`
)->a( n = `text` v = `One field`
Expand Down Expand Up @@ -332,8 +334,9 @@ CLASS z2ui5_cl_smp_app_067 IMPLEMENTATION.
)->tag( `Label`
)->a( n = `text` v = `Documentation`
)->tag( `Link`
)->a( n = `text` v = `https://sdk.openui5.org/api/sap.ui.model.odata.type.String%23methods/formatValue`
)->a( n = `href` v = `https://sdk.openui5.org/api/sap.ui.model.odata.type.String%23methods/formatValue`
)->a( n = `text` v = `https://sdk.openui5.org/api/sap.ui.model.odata.type.String%23methods/formatValue`
)->a( n = `href` v = `https://sdk.openui5.org/api/sap.ui.model.odata.type.String%23methods/formatValue`
)->a( n = `target` v = `_blank`
)->tag( `Label`
)->a( n = `text` v = `Numeric`
)->tag( `Input`
Expand Down
2 changes: 0 additions & 2 deletions docs/cookbook/model/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,8 @@ CLASS z2ui5_cl_sample_nested_struc IMPLEMENTATION.
)->tag( `Text`
)->a( n = `text` v = `{PRODUCT}`
)->tag( `Text`
" abap2ui5lint-disable-next-line unknown-binding-path -- linter defect, fixed in @abap2ui5/linter 0.2.0: a nested BEGIN OF inside a row type was dropped. Delete this line with the pin bump; the path is correct
)->a( n = `text` v = `{S_DETAILS/CREATE_DATE}`
)->tag( `Text`
" abap2ui5lint-disable-next-line unknown-binding-path -- same, and it goes with the same pin bump
)->a( n = `text` v = `{S_DETAILS/CREATE_BY}` ).

client->view_display( view->stringify( ) ).
Expand Down
22 changes: 17 additions & 5 deletions docs/cookbook/popup_popover/popup.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ CLASS z2ui5_cl_sample_confirm DEFINITION PUBLIC.
INTERFACES z2ui5_if_app.

DATA mv_question TYPE string.
DATA mv_confirmed TYPE abap_bool.

METHODS confirmed
RETURNING
VALUE(result) TYPE abap_bool.

PROTECTED SECTION.
DATA mv_confirmed TYPE abap_bool.

PRIVATE SECTION.
ENDCLASS.

Expand Down Expand Up @@ -145,6 +150,12 @@ CLASS z2ui5_cl_sample_confirm IMPLEMENTATION.
ENDCASE.

ENDMETHOD.

METHOD confirmed.

result = mv_confirmed.

ENDMETHOD.
ENDCLASS.
```

Expand All @@ -161,17 +172,18 @@ CASE abap_true.

WHEN client->check_on_navigated( ).
DATA(lo_prev) = CAST z2ui5_cl_sample_confirm( client->get_app_prev( ) ).
IF lo_prev IS BOUND AND lo_prev->mv_confirmed = abap_true.
IF lo_prev IS BOUND AND lo_prev->confirmed( ) = abap_true.
delete_entry( ).
ENDIF.
view_display( ).

ENDCASE.
```

Two things carry the whole pattern: the popup's answer is a **public attribute**
on its own instance, and `get_app_prev( )` is how the caller reaches it. Nothing
is passed back through events.
Two things carry the whole pattern: the popup's answer is an **attribute** on
its own instance, and `get_app_prev( )` is how the caller reaches it. Nothing
is passed back through events. No view binds the answer, so it stays
protected and the caller reads it through `confirmed( )`.

A ready-made set of these — confirm, select, ranges, file up- and download and
about a dozen more — is the
Expand Down
Loading
Loading