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
+21-31Lines changed: 21 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,37 +64,35 @@ 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 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 first the UI5 Control Tree and then renders 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?
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:
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:
<em>abap2UI5 – HTML is generated from XML View and data, both sent from the server</em>
83
81
</p>
84
82
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
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.
86
84
87
85
#### How can we exchange events from the frontend to the backend?
88
86
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:
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.
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:
95
+
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:
@@ -110,6 +108,8 @@ Now, we only need a single dummy UI5 app, and all views and logic can be central
110
108
<em>subtitle</em>
111
109
</p>
112
110
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,18 +121,19 @@ 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
-
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:
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:
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
-
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.
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:
134
136
135
-
A typical response from the backend now includes both the UI definition (view) and the data model:
136
137
```json
137
138
{
138
139
"S_FRONT": {
@@ -151,7 +152,6 @@ A typical response from the backend now includes both the UI definition (view) a
we can not consume odata or cds directly in the abap layer and only send the view + view model to the frontend. furthermore we can use make tings editable and send it directly to the backend and exchange data.
180
-
181
-
#### Partial HTML Updates
180
+
#### Can we do partial HTML Updates?
182
181
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?
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?
184
183
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:
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:
188
185
189
186
```abap
190
187
CLASS z2ui5_cl_demo_app_025 DEFINITION PUBLIC CREATE PUBLIC.
@@ -219,16 +216,9 @@ In the comparison below, you can see the difference between a full re-render and
219
216
<em>You can see the difference: partly vs. not</em>
220
217
</p>
221
218
222
-
All credit goes to the powerful UI5 data binding system, which automatically detects changes in the bound model and updates only the affected DOM elements. This results in a stable UI and smooth user experience—for example, input focus is preserved even during updates.
223
-
224
-
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:
225
-
226
-
```abap
227
-
client->view_model_update( ).
228
-
```
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.
229
220
230
-
By relying solely on view_model_update, the UI5 framework intelligently updates only the relevant parts of the DOM. It does not re-render the entire view but selectively refreshes the controls that are bound to updated data. 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.
231
-
The result is an efficient, responsive, and low-maintenance application architecture that brings the best of UI5 and ABAP together.
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.
232
222
233
223
#### Summary
234
224
@@ -247,9 +237,9 @@ Limitations:
247
237
- Offline functionality or complex client-side interactions are not covered
248
238
- Less effective if frontend and backend teams work independently
249
239
250
-
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.
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
241
252
-
Happy ABAPing!
242
+
Give it a try now. Happy ABAPing! 🦖
253
243
254
244
**References:**
255
245
-[htmx in a nutshell](https://htmx.org/docs/#introduction)
0 commit comments