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
Copy file name to clipboardExpand all lines: docs/advanced/technical/concept.md
+33-22Lines changed: 33 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,35 +64,37 @@ Because UI5 is a client-side rendering framework, HTML cannot be generated on th
64
64
65
65
#### How can we send the View from the backend?
66
66
67
-
Fortunately, UI5 has a defining characteristic that allows us to shift part of the view generation to the backend. Normally, each view is defined in XML — the so-called UI5 XML View. The UI5 framework uses this XML, along with the data provided by the backend, to generate first the UI5 Control Tree and then renders the HTML in the browser.
67
+
Fortunately, UI5 has a defining characteristic that allows us to shift part of the view generation to the backend. Normally, each view is defined in XML — the so-called UI5 XML View. The UI5 framework uses this XML, along with the data provided by the backend, to generate the HTML in the browser.
<em>UI5 Freestyle – HTML is generated from XML View and data sent via OData</em>
73
73
</p>
74
74
75
-
abap2UI5 introduces now a subtle shift: what if the server also delivers the XML view? Although HTML rendering still occurs on the frontend, all relevant information — the view and the data — is provided by the backend via AJAX:
75
+
abap2UI5 introduces now a subtle shift: what if the server also delivers the XML view?
76
+
77
+
Although HTML rendering still occurs on the frontend, all relevant information — the view and the data — is provided by the backend via AJAX:
<em>abap2UI5 – HTML is generated from XML View and data, both sent from the server</em>
81
83
</p>
82
84
83
-
The UI5 application remains a single-page application (SPA), but its role shifts to that of a pure rendering engine for server-defined UI and data.
85
+
The UI5 application remains a single-page application (SPA), but its role shifts to that of a pure rendering engine for server-defined UI and data unaware of the current view structure (e.g., table, list, input fields) or the subsequent application flow
84
86
85
87
#### How can we exchange events from the frontend to the backend?
86
88
87
-
We now add additional interaction by placing minimal static code in the frontend that sends events to the backend. The app renders the provided view and data, and whenever an event is triggered, the event information is passed to the backend. The backend in the abap class then decides what should happen next. All business logic is handled in the backend and this interaction model closely resembles the classical PAI/PBO model from SAP GUI applications.
89
+
We now add additional interaction by placing minimal static code in the frontend that sends events to the backend. This interaction model closely resembles the classical PAI/PBO model from SAP GUI applications. The app renders the provided view and data, and whenever an event is triggered, the event information is passed to the backend. The backend in the abap class then decides what should happen next. All business logic is handled in the backend:
The frontend application is a static UI5 shell, delivered with the first HTTP request: With this approach, the static logic remains in the frontend, while the backend handles each app as a selfcontained ABAP class — no need for dedicated frontend apps anymore. Previously, in UI5 freestyle we had to maintain many frontend artifacts:
97
+
The frontend application is a static UI5 shell, delivered with the first HTTP request: With this approach, the static logic remains in the frontend, while the backend handles the dynamic logic through ABAP classes. Each app becomes a self-contained ABAP class—no need for dedicated frontend apps anymore. Previously, we had to maintain many frontend artifacts:
@@ -108,8 +110,6 @@ Now, we only need a single dummy UI5 app, and all views and logic can be central
108
110
<em>subtitle</em>
109
111
</p>
110
112
111
-
Further advantages arise with no need for deloyment of frontend artifacts, we only have abaoGit compatible backend artefacts.
112
-
113
113
#### How Can We Exchange Data and Make It Editable?
114
114
115
115
So far, we’ve seen how to display data in a backend-driven approach. But how do we handle changes made on the frontend? If we still rely on OData, any update would typically be routed into the OData implementation layer, not into the ABAP class that also defines the view in abap2UI5. To solve this, abap2UI5 uses the concept of a View Model.
@@ -121,19 +121,18 @@ In standard UI5, view models (often JSON models) are used to bind attributes suc
121
121
<br/>
122
122
<em>subtitle</em>
123
123
</p>
124
-
125
-
Here comes the second key shift: Instead of binding to OData we bind the view to a custom JSON model, explicitly assembled in the backend. This model is sent together with the view to the frontend:
124
+
Here comes the second key shift: Instead of binding to OData, abap2UI5 binds to a custom JSON model, explicitly assembled in the backend. This model is sent together with the view to the frontend:
This means we no longer consume CDS Views or OData services directly on the frontend. Instead, we send the view and its data model together from the backend. Any changes made in the UI can then be sent directly back to the backend via simple AJAX, without OData routing.
132
132
133
-
This means we no longer consume CDS Views or OData services directly on the frontend. Instead, we send the view and its data model together from the backend. Any changes made in the UI can then be sent directly back to the backend via simple AJAX, without OData routing. The abap2UI5 framework has some deeicated logic to geenrate the view model outmatically out of the attributes of your abap classes via the methids `_bind` and `_bind_eit`:
134
-
135
-
A typical response from the backend now includes both the XML UI5 View and the JSON View model:
133
+
The abap2UI5 framework provides binding helpers and handles editable states, field values, and validation—all within ABAP classes. App developers do not need to deal with model configuration or UI binding logic manually.
136
134
135
+
A typical response from the backend now includes both the UI definition (view) and the data model:
137
136
```json
138
137
{
139
138
"S_FRONT": {
@@ -152,6 +151,7 @@ A typical response from the backend now includes both the XML UI5 View and the J
With this model, the frontend simply renders what the backend provides and sends back any updates. No direct use of OData or CDS Views is required in the frontend. Editable fields, validations, and roundtrips are all handled seamlessly within the backend.
180
+
181
+
#### Partial HTML Updates
181
182
182
-
A central feature of the HTML Over the Wire approach is that only the affected parts of the HTML page are updated, rather than the entire document. Can this be achieved in UI5?
183
+
A central feature of the HTML Over the Wire approach is that only the affected parts of the page are updated, rather than the entire document. Can this be achieved in UI5?
183
184
184
-
While changing the entire XML View in UI5 typically results in a full re-render, abap2UI5 makes partial updates possible by updating only the view model. This allows UI5 to efficiently update only the relevant UI controls through data binding — without rebuilding the entire view. Consider this example:
185
+
While changing the entire XML View in UI5 typically results in a full re-render, abap2UI5 makes partial updates possible by updating only the view model. This allows UI5 to efficiently update only the relevant UI controls through data binding—without rebuilding the entire view.
186
+
187
+
Consider this example:
185
188
186
189
```abap
187
190
CLASS z2ui5_cl_demo_app_025 DEFINITION PUBLIC CREATE PUBLIC.
@@ -216,13 +219,21 @@ In the comparison below, you can see the difference between a full re-render and
216
219
<em>You can see the difference: partly vs. not</em>
217
220
</p>
218
221
219
-
First you see the effect of the fill rerender and then when only the first input feld gets rerndert only, this results in a stable UI and smooth user experience — for example, input focus is preserved even during updates.. By relying solely on view_model_update, the UI5 framework intelligently updates only the effected parts of the DOM. It does not re-render the entire view but selectively refreshes the controls that are bound to updated data. To ensure optimal performance and UX, you should minimize full view re-renders. A complete re-render can degrade performance and interrupt the user’s workflow. Instead, use `client->view_model_update( )` as often as possible.
222
+
In the following illustration, you can see the difference between a full re-render and a targeted view model update:
223
+
224
+
Thanks to UI5's powerful data binding mechanism, only the affected DOM elements are updated. This preserves the UI state—for example, the input focus remains intact—and provides a fluid user experience.
225
+
226
+
To ensure optimal performance and responsiveness, avoid unnecessary full re-renders. Instead, use:
220
227
221
-
All credit goes to the powerful UI5 data binding system wich make UI5 a perfect team player for the HTML Over-the-Wire approach, where the ABAP backend is responsible for building both the UI5 XML VIew and its View Model.
228
+
```abap
229
+
client->view_model_update( ).
230
+
```
231
+
This makes UI5 a perfect team player for the HTML Over-the-Wire approach, where the ABAP backend is responsible for building both the UI structure and its dynamic state.
232
+
The result is an efficient, responsive, and low-maintenance application architecture that brings the best of UI5 and ABAP together.
222
233
223
234
#### Summary
224
235
225
-
abap2UI5 is to bring the simplicity and efficiency of the HTML Over-the-Wire paradigm into the SAP ecosystem.
236
+
abap2UI5 brings the simplicity and efficiency of HTML Over-the-Wire into the ABAP ecosystem.
226
237
227
238
Key Benefits:
228
239
- Static UI5 Frontend Application: Delivered with the initial HTTP request; generic and consistent across all use cases
@@ -237,9 +248,9 @@ Limitations:
237
248
- Offline functionality or complex client-side interactions are not covered
238
249
- Less effective if frontend and backend teams work independently
239
250
240
-
By relocating UI control to the ABAP backend and using UI5 purely for HTML rendering, abap2UI5 enables pragmatic, maintainable business application development — without the complexity of SPA architectures. For common enterprise use cases like dashboards, transactional forms, or reporting apps, it offers a clean, backend-driven alternative with shorter development cycles.
251
+
By relocating UI control to the ABAP backend and using UI5 purely for HTML rendering, abap2UI5 enables pragmatic, maintainable business application development — without the complexity of SPA architectures. It offers a clean, backend-driven alternative perfect for enterprise use cases with short development cycles.
241
252
242
-
Give it a try now. Happy ABAPing! 🦖
253
+
Happy ABAPing!
243
254
244
255
**References:**
245
256
-[htmx in a nutshell](https://htmx.org/docs/#introduction)
0 commit comments