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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ npm run dev # dev server, http://localhost:4321/insights/
npm run build # dist/
npm test # the tests, against dist/ - build first
npm run check # build + test, what CI runs
npm run report:sentences # sentences over 35 words; a report, not a test
```

## Rules
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"preview": "astro preview",
"migrate": "node scripts/migrate.mjs",
"test": "node --test test/*.test.mjs",
"check": "npm run build && npm test"
"check": "npm run build && npm test",
"report:sentences": "node scripts/report-sentences.mjs"
},
"devDependencies": {
"astro": "7.3.8",
Expand Down
65 changes: 65 additions & 0 deletions scripts/report-sentences.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env node
// The long sentences of the essays, longest first. A report, not a test:
// `npm run check` does not call it. Many readers read English as a second
// language, and a sentence of fifty words with two asides is where they stop.
//
// node scripts/report-sentences.mjs every sentence over 35 words
// node scripts/report-sentences.mjs --max 30 another limit
// node scripts/report-sentences.mjs --full the whole sentence, not its start
//
// The same rules as the report of abap2UI5/docs: an inline code span counts
// as one word, a link counts by its text, and fenced code, tables, headings,
// image lines and the frontmatter are not sentences.

import { readdirSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

const ESSAYS = join(dirname(fileURLToPath(import.meta.url)), '..', 'src', 'content', 'essays');
const args = process.argv.slice(2);
const maxAt = args.indexOf('--max');
const max = maxAt === -1 ? 35 : Number(args[maxAt + 1]);
const full = args.includes('--full');

export function sentences(markdown) {
const body = markdown.replace(/^---\n[\s\S]*?\n---\n/, (m) => m.replace(/[^\n]/g, ''));
const out = [];
let paragraph = [];
let start = 0;
let fence = false;
const flush = () => {
const text = paragraph.join(' ').replace(/\s+/g, ' ').trim();
for (const s of text.split(/(?<=[.!?:]\**[)"”]?)\s+(?=[A-Z*[(]|abap2UI5\b)/)) {
const words = s.split(' ').filter((w) => /\p{L}/u.test(w));
const prose = words.filter((w) => w !== 'Code').length;
if (words.length && prose > words.length / 2) out.push({ line: start, words: words.length, text: s });
}
paragraph = [];
};
body.split('\n').forEach((line, i) => {
if (/^\s*```/.test(line)) { fence = !fence; return flush(); }
if (fence) return;
if (/^\s*!\[/.test(line)) return flush();
const t = line
.replace(/(`+)[\s\S]*?\1/g, ' Code ')
.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
.trim();
if (!t || /^(#|\||!\[|\*[^*].*\*$)/.test(t)) return flush();
if (/^([-*]|\d+\.)\s/.test(t)) flush();
if (!paragraph.length) start = i + 1;
paragraph.push(t.replace(/^([-*]|\d+\.)\s+/, ''));
});
flush();
return out;
}

let total = 0;
let long = 0;
for (const name of readdirSync(ESSAYS).filter((f) => f.endsWith('.md')).sort()) {
const all = sentences(readFileSync(join(ESSAYS, name), 'utf8'));
const over = all.filter((s) => s.words > max).sort((a, b) => b.words - a.words);
total += all.length;
long += over.length;
for (const s of over) console.log(`${name}:${s.line} ${s.words} words ${full ? s.text : `${s.text.slice(0, 90)}…`}`);
}
console.log(`report-sentences: ${long} of ${total} sentences over ${max} words (${total ? ((100 * long) / total).toFixed(1) : 0}%).`);
4 changes: 1 addition & 3 deletions src/content/essays/02-somewhere-on-the-way-to-ui5.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ A table nobody described, drawn from whatever the data turned out to be —
[se16n addon](https://github.com/abap2UI5-addons/se16n), a full SE16-flavored
app built on exactly this.

Nothing in either half is exotic, which is what makes it cheap to hand over:
the frontend is a freestyle UI5 app with `sap.m` controls and a `JSONModel`,
and the backend is a global ABAP class in a package, traveling in a transport.
Nothing in either half is exotic, and that makes it cheap to hand over. The frontend is a freestyle UI5 app with `sap.m` controls and a `JSONModel`. The backend is a global ABAP class in a package, traveling in a transport.

## What It Costs

Expand Down
8 changes: 2 additions & 6 deletions src/content/essays/03-one-class-no-programming-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ blurb: "every API the system has, from BAPI to EML, behind one unchanged UI clas
description: "The one interface an abap2UI5 app implements, and why three save handlers - EML, a MODIFY, a BAPI - sit behind one unchanged UI class."
---

To use a framework, you always have to fulfill certain requirements: these can
be a structure to follow, a lifecycle to fit into, layers to fill in — most of
them in place before anything reaches a screen.
To use a framework, you always have to fulfill certain requirements. These can be a structure to follow, a lifecycle to fit into, or layers to fill in. Most of them have to be in place before anything reaches a screen.

Here is the whole list for abap2UI5. You write an ABAP class — the way you used
to start a report with a selection screen — and implement one interface with
Expand Down Expand Up @@ -200,9 +198,7 @@ one that waits for a modeling exercise.
## Conclusion

Where a strict programming model fits, use it — picking one deliberately is
good engineering. abap2UI5 asks for nothing beyond the signature of `main( )`,
so it fits the rest: the system not on the newest release, the logic that does
not match the shape a model has in mind, and the screen from
good engineering. abap2UI5 asks for nothing beyond the signature of `main( )`, so it fits the rest. That is the system not on the newest release, the logic that does not match the shape a model has in mind, and the screen from
[#1](/insights/01-the-cost-of-a-screen/) whose whole
backend is one class. Where it sits next to RAP is
[#36](/insights/36-rap-or-abap2ui5/).
Expand Down
6 changes: 1 addition & 5 deletions src/content/essays/09-one-handler-for-every-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ one. No contract is registered, so none can be violated.
## How Much Handler That Is

The communication core of abap2UI5 started as one HTTP handler class, two
interfaces and one database table. The framework has grown since — most
visibly the optional view builder — and the part that carries every request is
now a dozen small classes in the core package (handler, action, binding, model,
events, draft) behind the same two interfaces and the same one table,
`z2ui5_t_01`.
interfaces and one database table. The framework has grown since, most visibly by the optional view builder. The part that carries every request is now a dozen small classes in the core package: handler, action, binding, model, events, draft. They sit behind the same two interfaces and the same one table, `z2ui5_t_01`.

It is small because of what it leaves to the apps. The framework does not build
views; apps do. It does not decide program flow; apps do. It does not wrap UI5
Expand Down
5 changes: 1 addition & 4 deletions src/content/essays/11-a-new-instance-on-every-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ cursor, an acquired lock, a reference to a class that is not serializable. The

One consequence surprises even experienced ABAP developers, because in a
dialog program the habit was free: every attribute is written to the database
after every click. A catalog that is read once and kept in an attribute "as a
cache" is therefore written and read back on every click, whether the
attribute is public or protected, and it makes every click slower for as long
as the app runs. No keyword fixes that. Read anything large again per request,
after every click. So a catalog that is read once and kept in an attribute "as a cache" is written and read back on every click, whether the attribute is public or protected. It makes every click slower for as long as the app runs. No keyword fixes that. Read anything large again per request,
and keep the instance as small as the screen needs.

The rule pays off. The app feels stateful — PBO, PAI, cancel, back — while
Expand Down
6 changes: 2 additions & 4 deletions src/content/essays/13-where-the-selection-screen-went.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ is a variable, in a class, next to the code that reads it.

![The attribute is bound, appears as a path in the view and the model, the Input shows it, and what the user types travels back into the attribute before main( ) runs.](/insights/13-bound-value.svg)

*One attribute, there and back.*
*One attribute, there and back. The picture uses an attribute `quantity` as its example; `pa_arbgb` above travels the same way.*

One half of `PARAMETERS` does not come back: the layout is written by hand
here, because the screen is UI5 and UI5 offers far more than a selection
screen did. The other half does: the data lives in one place, and no service
sits between the field and the variable.

For a report that already exists, the hand-written layout has a shortcut.
report2UI5 converts a classic report's user interface — the selection screen,
the event blocks, the `WRITE` list, the ALV, the messages — into a class that
renders through abap2UI5, and leaves the report's logic as it was
The tool report2UI5 converts a classic report's user interface into a class that renders through abap2UI5: the selection screen, the event blocks, the `WRITE` list, the ALV, the messages. It leaves the report's logic as it was
([Report Migration](https://abap2ui5.github.io/docs/advanced/report_migration)).

**In short:** `_bind( )` makes a public attribute and a field on the screen
Expand Down
5 changes: 1 addition & 4 deletions src/content/essays/16-no-build-no-deploy-no-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ description: "What is missing from change, activate, refresh - no frontend build
The loop is: change the class, activate, refresh the browser.

This article is about what is *missing* from that sentence, starting with the
first page. Somebody has to deliver the initial HTML. In the SAP world that
normally means a BSP application: a frontend artifact that is built somewhere,
deployed to the ABAP stack, transported on its own path, and removed from its
own caches when it changes.
first page. Somebody has to deliver the initial HTML. In the SAP world that normally means a BSP application. It is a frontend artifact that is built somewhere, deployed to the ABAP stack and transported on its own path. When it changes, it has to be removed from its own caches.

abap2UI5 needs no BSP when it is started through its own ICF service, which is
the normal installation. The initial GET is answered from ABAP source code:
Expand Down
4 changes: 1 addition & 3 deletions src/content/essays/19-where-the-url-went.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,4 @@ The details, with the cases that combine with the launchpad, are on
[App State](https://abap2ui5.github.io/docs/cookbook/event_navigation/navigation/app_state)
and [Hash Routing](https://abap2ui5.github.io/docs/cookbook/event_navigation/navigation/hash).

**In short:** by default the URL carries nothing and a reload starts the app
fresh; app state, hash routing or an app-owned hash put as much of the app
into the URL as the app chooses.
**In short:** by default the URL carries nothing and a reload starts the app fresh. App state, hash routing or an app-owned hash put as much of the app into the URL as the app chooses.
10 changes: 2 additions & 8 deletions src/content/essays/22-where-the-luw-ends.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,11 @@ commits, as in [#3](/insights/03-one-class-no-programming-model/). EML
transaction, so the business object's save sequence starts on the app's
command ([#36](/insights/36-rap-or-abap2ui5/)).

**A failed roundtrip is rolled back too.** An exception that leaves `main( )`
is caught once, in the framework's handler, and the LUW is rolled back before
the HTTP 500 goes out — the same outcome a short dump had, and the overlay the
user sees is the one from [#21](/insights/21-message-still-works/). That
**A failed roundtrip is rolled back too.** An exception that leaves `main( )` is caught once, in the framework's handler, and the LUW is rolled back before the HTTP 500 goes out. That is the same outcome a short dump had. The overlay the user sees is the one from [#21](/insights/21-message-still-works/). That
rollback matters: the end of the HTTP request commits implicitly, and without
it a write made just before the raise would land after all.

**Every roundtrip is its own LUW.** Nothing written in one click is still open
in the next, so a change that spans two screens — a header on the first, items
on the second — is either collected in attributes and written in one go, or
written per screen with a status that says it is not finished. That is the
**Every roundtrip is its own LUW.** Nothing written in one click is still open in the next. Take a change that spans two screens, a header on the first and items on the second. It is either collected in attributes and written in one go, or written per screen with a status that says it is not finished. That is the
same decision a stateless web application makes everywhere, and the same one
[#23](/insights/23-the-lock-is-gone-by-the-next-click/) makes for locks.

Expand Down
4 changes: 1 addition & 3 deletions src/content/essays/23-the-lock-is-gone-by-the-next-click.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ with the edge cases, on [Lock](https://abap2ui5.github.io/docs/cookbook/expert_m

*The lock lives inside one roundtrip; the timestamp guards the minutes between.*

**A soft lock** — a row in a table of your own saying who is editing what,
with a timestamp that expires — gives the *this order is being edited by
Müller* warning back, without a work process holding anything. It is advisory,
**A soft lock** is a row in a table of your own that says who is editing what, with a timestamp that expires. It gives the *this order is being edited by Müller* warning back, without a work process holding anything. It is advisory,
it can go stale, and users like it anyway.

**And the GUI way still exists.** `client->set_session_stateful( )` pins one
Expand Down
4 changes: 1 addition & 3 deletions src/content/essays/25-who-may-start-which-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ usual in PFCG. Nothing here is new, and that is the point. The check sits in
the class it protects, so a transport carries the app and its guard together,
and nothing on the node has to know which classes exist.

It also holds on the way into an app that the URL never names: a
`nav_app_call( )` from another app arrives as an ordinary roundtrip with no
`app_start` on it, and the check in `main( )` is the one that runs for it. A
It also holds on the way into an app that the URL never names. A `nav_app_call( )` from another app arrives as an ordinary roundtrip with no `app_start` on it, and the check in `main( )` is the one that runs for it. A
guard on the node alone would miss that call. The complete example,
with the refusal branch and what it should say, is on
[Authorization](https://abap2ui5.github.io/docs/configuration/authorization).
Expand Down
10 changes: 2 additions & 8 deletions src/content/essays/26-100-rows-four-hours-one-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ from ABAP:

Raising it is the fix for a table of a thousand rows. It is not the fix for a
table of fifty thousand: every bound row travels to the browser with the
response, and back to the database with the draft. A screen with that
many rows does the paging in ABAP: it reads one page with `SELECT … UP TO n
ROWS`, uses a growing table or offers a filter bar — the way a selection
screen always limited the result.
response, and back to the database with the draft. A screen with that many rows does the paging in ABAP. It reads one page with `SELECT … UP TO n ROWS`, uses a growing table or offers a filter bar, the way a selection screen always limited the result.

**Four hours.** The draft — the framework's saved copy of the app instance
from [#11](/insights/11-a-new-instance-on-every-request/), not a RAP draft —
lives in `z2ui5_t_01` until it expires, four hours by default. A user who comes
back after lunch continues where they were; one who comes back tomorrow starts
fresh. The number is `draft_exp_time_in_hours` in the exit class
(`z2ui5_if_ui5_exit`), and this table
is the one place in the framework that grows. It is also the one that cleans
itself: on every first start of an app the framework deletes every row older
than the expiry, one `DELETE` and a `COMMIT WORK`, so the table holds at most
the clicks of the last four hours. How that adds up for a given number of
is the one place in the framework that grows. It is also the one that cleans itself. On every first start of an app the framework deletes every row older than the expiry, with one `DELETE` and a `COMMIT WORK`. So the table holds at most the clicks of the last four hours. How that adds up for a given number of
users is [#40](/insights/40-how-many-users/).

**One request.** Every click is one HTTP roundtrip plus one read and one write
Expand Down
6 changes: 2 additions & 4 deletions src/content/essays/33-when-the-api-is-not-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ and a wrapper keeps an unreleased API in one named place.

*The levels are SAP's, from the
[Clean Core Extensibility white paper](https://community.sap.com/t5/technology-blog-posts-by-sap/why-clean-core-matters-get-some-insights-into-our-brand-new-extensibility/ba-p/14163750)
of August 2025; the
[ABAP Extensibility Guide](https://community.sap.com/t5/technology-blog-posts-by-sap/abap-extensibility-guide-clean-core-for-sap-s-4hana-cloud-august-2025/ba-p/14175399)
carries the technical rules behind each one, and
[Clean Core maturity and the new extensibility levels](https://community.sap.com/t5/technology-blog-posts-by-sap/clean-core-maturity-and-the-new-extensibility-levels/ba-p/14293974)
of August 2025. The [ABAP Extensibility Guide](https://community.sap.com/t5/technology-blog-posts-by-sap/abap-extensibility-guide-clean-core-for-sap-s-4hana-cloud-august-2025/ba-p/14175399)
carries the technical rules behind each one. [Clean Core maturity and the new extensibility levels](https://community.sap.com/t5/technology-blog-posts-by-sap/clean-core-maturity-and-the-new-extensibility-levels/ba-p/14293974)
covers grading code that already exists.*
4 changes: 1 addition & 3 deletions src/content/essays/35-one-app-many-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ Which S/4 system a request is about is therefore a value the app holds. It is
an attribute of the instance, set when the user chose the system or when the
launchpad parameter named it (`client->get( )-t_comp_params`, which is
[user input](https://abap2ui5.github.io/docs/configuration/authorization#startup-parameters-are-user-input)).
That attribute behaves like every other one: it is serialized with the
instance, it travels to the browser if it is bound, and `nav_app_call( )`
passes it on only if the caller puts it into the sub-app it constructs.
That attribute behaves like every other one. It is serialized with the instance, and it travels to the browser if it is bound. `nav_app_call( )` passes it on only if the caller puts it into the sub-app it constructs.

So the check belongs where the remote call is made. Every read and every write
names the system key from the instance, and the app verifies first that *this*
Expand Down
6 changes: 1 addition & 5 deletions src/content/essays/37-freestyle-or-abap2ui5.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ cases, and each is a consequence of [#7](/insights/07-one-click-one-request/): e
event is a request to the server, and nothing runs between two of them.

- **No offline-first app.** Every event asks the server what happens next, and
the page itself needs the network to load. What exists is an experimental
event queue, `cs_event-offline_queue`: the events it names wait in the
browser while the backend cannot be reached, survive a reload, and are sent
in order once the network is back — a form that saves later, not an app
that works without a server. A warehouse app for a device with no signal is
the page itself needs the network to load. What exists is an experimental event queue, `cs_event-offline_queue`. The events it names wait in the browser while the backend cannot be reached, survive a reload, and are sent in order once the network is back. That is a form that saves later, not an app that works without a server. A warehouse app for a device with no signal is
a different architecture.
- **Real-time and heavily interactive UIs do not fit.** Drag and drop across a
board, a canvas, live collaboration: anywhere the important state lives in
Expand Down
Loading
Loading