You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: second clarity pass — beginner journey, code correctness, consistency
- quickstart: state the endpoint URL (SICF Test Service), map the
ABAP/ABAP Cloud tabs to system types, explain the Handler List step,
how to launch your own class, abapGit prerequisite, and a naming tip
(customer namespace vs. reserved Z2UI5_ prefix)
- hello_world/full_example: explain why bound attributes must be
public, the me->client pattern, shell( )/get_parent( ) and
get( )-event vs get_event_arg( ) on first use
- life_cycle: drop the false "used by every tutorial" claim and
acknowledge the equivalent IF/ELSEIF dispatch used by the tutorials
and samples
- snippets: replace the non-compiling "sorting/filtering" table example
(growing_threshold, sort_property/filter_property do not exist in the
builder or sap.m.Column) with a real backend-sorting example
- definition: fix Dialog cross-reference (Popup, not Popover) and the
builder property naming rule (selectedkey, not selected_key)
- binding: rename example class out of the reserved framework namespace
- smaller fixes: LO→L0 template variable, misleading button label,
Cookbook link target, ITS vs ITS Mobile, dispatch style unified
within abap_sql page, changelog note on check_on_event status
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EC2cWJafPETwcMbh3NCsgH
Copy file name to clipboardExpand all lines: docs/cookbook/eml_cds_sql/cds.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ outline: [2, 4]
3
3
---
4
4
# CDS
5
5
6
-
All examples in these docs work without CDS. But on a recent ABAP release, you can also use this feature in abap2UI5 apps.
6
+
All examples in these docs work without CDS. On a recent ABAP release, you can also read data through CDS views in your abap2UI5 apps.
7
7
8
8
### ABAP CDS
9
9
ABAP Core Data Services (CDS) let you define structured views and read data straight from the database. The example below fetches sales orders from the `I_SalesOrder` view of the Virtual Data Model (VDM) and shows them in a UI5 table:
Copy file name to clipboardExpand all lines: docs/cookbook/eml_cds_sql/draft_handling.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,7 +269,7 @@ ENDMETHOD.
269
269
`%is_draft = if_abap_behv=>mk-off` makes the read return the **active** row, not any open draft.
270
270
271
271
#### 2. Entering Edit Mode — Check for an Existing Draft
272
-
When the user clicks **Switch to Edit Mode**, the app first looks in the BO's draft-shadow table (here `cabnk_bank_d`) joined with `sdraft_admin` to find out whether a draft already exists for this key — and who owns it.
272
+
When the user clicks **Switch to Edit Mode**, the app first looks in the BO's draft-shadow table (here `cabnk_bank_d`) joined with `sdraft_admin` to find out whether a draft already exists for this key — and who owns it. (Simplified here; the full snippet at the end of the page additionally reads the draft's timestamp.)
Copy file name to clipboardExpand all lines: docs/cookbook/event_navigation/life_cycle.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ outline: [2, 4]
3
3
---
4
4
# Life Cycle
5
5
6
-
Every request enters the `main` method. `CASE abap_true` dispatches between initialization, navigation returns, and user events using `client->check_on_init( )`, `client->check_on_event( 'EVENT_NAME' )`, and `client->check_on_navigated( )`. Each branch either does the work inline (tiny apps) or calls a named handler method (typical apps) — the **structure is always the same**.
6
+
Every request enters the `main` method. `CASE abap_true` dispatches between initialization, navigation returns, and user events using ``client->check_on_init( )``, ``client->check_on_event( `EVENT_NAME` ) ``, and ``client->check_on_navigated( )``. Each branch either does the work inline (tiny apps) or calls a named handler method (typical apps) — the **structure is always the same**.
7
7
8
8
```abap
9
9
CLASS z2ui5_cl_demo_app_001 DEFINITION PUBLIC.
@@ -42,10 +42,10 @@ CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION.
42
42
ENDCLASS.
43
43
```
44
44
45
-
Three things make this the recommended shape, used by every tutorial in this guide:
45
+
Whether you dispatch with `CASE abap_true` (as above) or with an equivalent `IF` / `ELSEIF` chain (as the [Hello World](/get_started/hello_world) and [Full Example](/get_started/full_example) tutorials do) is a matter of taste — the structure is what counts. Three things make this the recommended shape:
46
46
47
47
1.**Store `client` on `me->client`** so handler methods can use it without passing it around.
48
-
2.**Dispatch by event name** — `check_on_event( 'POST' )` rather than a generic `check_on_event( )` followed by a second `CASE`. Each event gets its own `WHEN`.
48
+
2.**Dispatch by event name** — ``check_on_event( `POST` ) `` rather than a generic `` CASE client->get( )-event `` with a second dispatch level. Each event gets its own `WHEN`. (With many events or extracted handler methods, the `CASE client->get( )-event` form is a fine alternative — the [Full Example](/get_started/full_example) uses it.)
49
49
3.**One render method per view** — call it from any `WHEN` that should rebuild the screen (`check_on_init`, after a search, after a navigation return). Event handlers that only mutate state and reuse the existing view (a button press inside a popup, a toast) skip it — see [The View Is Only Sent When You Call `view_display`](#the-view-is-only-sent-when-you-call-view-display) below.
50
50
51
51
For a tiny app with one or two events, inline the view and the handler directly in the `WHEN` branches and skip the handler methods entirely. [Hello World](/get_started/hello_world) shows this variant; [Full Example](/get_started/full_example) shows the full version with multiple handler methods, a popup, and persistence. Both follow the same pattern — only the amount of code inside each branch differs.
Copy file name to clipboardExpand all lines: docs/cookbook/expert_more/snippets.md
+32-16Lines changed: 32 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,12 +174,12 @@ CLASS z2ui5_cl_app_table_basic IMPLEMENTATION.
174
174
ENDCLASS.
175
175
```
176
176
177
-
## Table with Filtering, Sorting
177
+
## Table with Sorting
178
178
179
-
Enable UI5's built-in column sorting and filtering by setting `sortProperty` and `filterProperty` on each column header. The `p13n` settings expose the personalization icon.
179
+
`sap.m.Table` has no built-in column sorting — in abap2UI5, sorting (and filtering) is backend work: react to an event, `SORT` the internal table in ABAP, and push the new order to the rendered view with `view_model_update`. No re-render needed:
180
180
181
181
```abap
182
-
CLASS z2ui5_cl_app_table_p13n DEFINITION PUBLIC.
182
+
CLASS z2ui5_cl_app_table_sort DEFINITION PUBLIC.
183
183
184
184
PUBLIC SECTION.
185
185
INTERFACES z2ui5_if_app.
@@ -193,7 +193,7 @@ CLASS z2ui5_cl_app_table_p13n DEFINITION PUBLIC.
193
193
194
194
ENDCLASS.
195
195
196
-
CLASS z2ui5_cl_app_table_p13n IMPLEMENTATION.
196
+
CLASS z2ui5_cl_app_table_sort IMPLEMENTATION.
197
197
METHOD z2ui5_if_app~main.
198
198
199
199
IF client->check_on_init( ).
@@ -206,22 +206,28 @@ CLASS z2ui5_cl_app_table_p13n IMPLEMENTATION.
Copy file name to clipboardExpand all lines: docs/cookbook/model/binding.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ In abap2UI5, there are two ways to share data between your ABAP code and the UI5
9
9
Use one-way binding to show data on the frontend without allowing edits. The `client->_bind` method sends data to the frontend and binds it to the view:
10
10
11
11
```abap
12
-
CLASS z2ui5_cl_app_hello_world DEFINITION PUBLIC.
12
+
CLASS zcl_app_hello_world DEFINITION PUBLIC.
13
13
14
14
PUBLIC SECTION.
15
15
INTERFACES z2ui5_if_app.
16
16
DATA name TYPE string.
17
17
18
18
ENDCLASS.
19
19
20
-
CLASS z2ui5_cl_app_hello_world IMPLEMENTATION.
20
+
CLASS zcl_app_hello_world IMPLEMENTATION.
21
21
METHOD z2ui5_if_app~main.
22
22
23
23
client->view_display( z2ui5_cl_xml_view=>factory(
@@ -35,15 +35,15 @@ This method works with tables, trees, and other nested data structures — see [
35
35
When users need to edit data, use two-way binding to keep it in sync with the ABAP backend. Call the `client->_bind_edit` method — after an event, the framework syncs the data back to your ABAP class:
Copy file name to clipboardExpand all lines: docs/cookbook/view/definition.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ outline: [2, 4]
5
5
6
6
abap2UI5 uses [SAP UI5](https://sapui5.hana.ondemand.com) on the frontend without modification. Whatever your ABAP code sends to the browser is a **standard UI5 XML view** — the same XML you would write in any UI5 freestyle project.
7
7
8
-
The consequence: **everything in the UI5 SDK works in abap2UI5 1:1**. Any control, any property, any namespace from the [UI5 Demo Kit](https://sapui5.hana.ondemand.com/sdk) is available. Copy the XML, paste it into your ABAP class, and it renders.
8
+
The consequence: **everything in the UI5 SDK works in abap2UI5 1:1 when you write the XML directly**. Any control, any property, any namespace from the [UI5 Demo Kit](https://sapui5.hana.ondemand.com/sdk) is available. Copy the XML, paste it into your ABAP class, and it renders.
9
9
10
10
#### Sending a View
11
11
@@ -94,7 +94,7 @@ The UI5 SDK is large. The table below covers the choices that come up in almost
94
94
| Multi-select dropdown |`sap.m.MultiComboBox`| Pills appear inside the field. |
95
95
| Date / time input |`sap.m.DatePicker` / `sap.m.TimePicker` / `sap.m.DateTimePicker`| Needs a formatter — see [Binding → Data-Type Mapping](/cookbook/model/binding#data-type-mapping). |
96
96
| Status indicator |`sap.m.ObjectStatus`| Colored text + icon for state. |
97
-
| Modal dialog |`sap.m.Dialog` (built with `factory_popup`) | See [Popover](/cookbook/popup_popover/popover).|
97
+
| Modal dialog |`sap.m.Dialog` (built with `factory_popup`) | See [Popup](/cookbook/popup_popover/popup). |
98
98
99
99
When two controls fit, prefer the simpler one: `Table` over `TreeTable`, `SimpleForm` over `Form`, `Select` over `ComboBox`. Switch to the richer variant only when a concrete requirement justifies it.
100
100
@@ -103,7 +103,7 @@ When two controls fit, prefer the simpler one: `Table` over `TreeTable`, `Simple
103
103
`Z2UI5_CL_XML_VIEW` is a hand-curated wrapper around UI5 controls. It does not cover every UI5 control, and the naming is not always a strict 1:1 mapping of the UI5 SDK:
104
104
105
105
- Control names follow snake_case of the UI5 control class — `sap.m.MultiComboBox` becomes `->multi_combo_box( )`, `sap.m.Text` becomes `->text( )`.
106
-
- Properties are passed as named parameters in snake_case (`enabled`, `placeholder`, `selected_key`).
106
+
- Properties are passed as named parameters, lowercased without underscores (`enabled`, `placeholder`, `selectedkey`, `growingthreshold`). Only the *method* names use snake_case (e.g. `multi_combo_box`).
107
107
- Aggregations are exposed as methods named after the aggregation itself (`->items( )`, `->content( )`, `->custom_data( )`) — not as `add_item( )` / `add_content( )`. Calling the aggregation method returns the parent builder so you can chain children inside it.
108
108
- Coverage is incomplete and occasionally inconsistent: some controls or properties are missing, some method signatures don't match the SDK exactly. When in doubt, check the source of `Z2UI5_CL_XML_VIEW` or fall back to the generic builder below.
0 commit comments