Technical decisions
Decisions taken on 2026-11-09, after the owner of the project approved the principle ("take the technical decisions you think are the best; all the features of a non-draft RAP BO must be respected"). Each entry gives the decision, the reason and the consequence. Numbers D1 to D13 correspond to points 1 to 13 of §11 of PLAN.md. The milestones M1 to M6 are those of PLAN.md §8.
D1 — BDEF grammar written with Chevrotain
- Decision: Chevrotain grammar for the BDEFs (managed behavior and projection); the BDEF parser of abaplint is used as an oracle in the tests.
- Why: typed AST, positioned error messages, full control over the handling of the out-of-scope constructs. The parser of abaplint only produces a generic tree.
- Consequence: two parsers to keep aligned; a test compares the entities, aliases and operations each one finds.
D2 — ABP: generated derived types and source-to-source rewrite
- Decision: for each managed BDEF, the compiler generates an ABAP interface (
ZRAP_DT_<BDEF>) containing the RAP derived types (%tky,%control,FOR …tables,FAILED/REPORTED/MAPPEDresponses, authorization and feature control requests and results), then rewrites the behavior pool before giving it to the transpiler: signatures of the handlers,TYPE TABLE|STRUCTURE|RESPONSE FOR …references, removal ofFOR BEHAVIOR OF, and all the EML statements (READ,MODIFY,COMMIT,ROLLBACK ENTITIES, long and short forms) lowered into calls of the kernel classZRAP_EML(begin, operations,end). The#of the operands become the expected derived type; the inline declarations (RESULT DATA(x)) are hoisted asDATA x TYPE …. - Adjustment (M4): the EML is parsed by a token-based parser of the project (
gen/abap/eml.ts), and no longer left to the lowering of the transpiler: abaplint does not recognize all the forms (CREATE AUTO FILL CID SET FIELDS WITHis an unknown statement for it), and the lowering of the transpiler lostIN LOCAL MODE,BY \_assoc,LINKandCREATE BY. The complete ABAP check (types included) runs on the rewritten sources, with the configuration of the transpiler; each replacement keeps the number of lines of the replaced text, so that the errors (ABP004) point to the original line. - Adjustment (feature control): as on SAP, the feature control requests and results (
FOR INSTANCE FEATURES,FOR GLOBAL FEATURES) only contain what the BDEF declares at the matching level:%create,%update,%deleteof the( features : … )operations,%action-xof the( features : … )actions,%assoc-_xof thecreate ( features : … ),%field-xof thefield ( features : instance )fields. A pool that writes%updatewithoutupdate ( features : instance )is refused (ABP004) instead of passingrapt checkand then failing on activation on SAP. - Why: abaplint types these constructs as
voidand the transpiler then refuses the ABP. The PoC (PLAN.md, V10) proved the approach with the published packages; M4 generalized it. - Consequence: the transpiler and the runtime are never patched nor monkeypatched; they are given standard ABAP. The methods of
ZRAP_EML, a "clean-room" class of the project, are replaced at runtime by the JavaScript kernel (runtime/src/rap/kernel.ts). Any construct the pass cannot handle produces a diagnostic (ABP005 to ABP007) and an entry in KNOWN_GAPS.md. An upstream contribution (derived types in abaplint) remains desirable; it is public and will only be proposed with the agreement of the owner of the project.
D3 — Fastify rather than Express
- Why:
inject()lets the server be tested without a network; encapsulated plugins; good TypeScript typing; performance.
D4 — OData reads through generated SQL views
- Decision: each CDS view becomes a PostgreSQL view (
zr_*on the tables, thenzc_*onzr_*). The OData reads query thezc_*views; the writes go through the RAP runtime, to the tables. - Why: it is the separation of RAP (query through the CDS projection, transaction through the BO). Future CDS expressions (CASE, CAST…) will translate directly into SQL.
D5 — OData scope extended to what a V4 List Report / Object Page sends
- Decision: in addition to the initial list: navigation
Entity(…)/_Assoc(read and creation),ge,le,not,startswith,endswith,/$countsegment, simple$search, CSRF token,IEEE754Compatible=true, one-level deep insert,sap-messagesheader,$<Content-ID>references in a changeset,sap-*parameters ignored. - Why: without them, a Fiori Elements V4 application (or our OpenUI5 UI, which uses the same ODataModel) does not fully work.
D6 — Path of the service modeled on RAP
- Decision: by default
/sap/opu/odata4/sap/<binding>/srvd/sap/<srvd>/0001/, configurable. - Why: an existing Fiori Elements application can point to the service without changing its manifest.
D7 — Fixture activatable as is on a real system
- Decision: the
fixtures/travelfixture is a complete and consistent abapGit export (strict(2), global authorization, managed numbering…). The authorization is no longer ignored: it is part of the supported non-draft features (D14). - Why: the reference behavior can be checked on an SAP system.
D8 — Timestamps as timestamptz(6)
- Decision:
TIMESTAMPL/UTCLONG→timestamptz(6),TIMESTAMP→timestamptz(0). - Why: natural type in SQL and for the OData filters. The timestamps generated by the runtime are to the microsecond, which keeps the ETags stable.
- Consequence: the seventh ABAP decimal is lost (KNOWN_GAPS.md).
- Adjustment (M4):
@abaplint/runtime2.14.24 stores the packed numbers in an exact form (scaledBigIntinteger). The conversions between the buffer and ABAP go through text (toFixed): aTIMESTAMPLreaches the ABP intact and comes back intact. Only the arithmetic operations of the runtime on packed numbers go through JavaScript numbers (KNOWN_GAPS.md). The ETags are canonical values of the buffer, never recomputed by the ABP.
D9 — Client removed
- Decision: the
CLNTcolumn (CLIENT,MANDT) is removed from the tables; single-tenant application.
D10 — Freestyle OpenUI5 1.136 LTS UI
- Decision:
sap.m,sap.f,sap.uxap,sap.ui.layoutcontrols,sap_horizontheme, ODataModel V4 withautoExpandSelect.sap.ui.mdcis a possible evolution. - Why: Apache-2.0 libraries; the ODataModel V4 is the one of Fiori Elements V4.
- Version: OpenUI5 1.154 since D121 (1.136 is out of maintenance).
- Implementation (M5):
rapt buildwritesui/: one List Report XML view per root entity set and one Object Page view per entity set, generated from the@UIannotations (same derivation as the CSDL), and generic controllers driven byui/model/layout.json(filters, search, non-draft creation, edit and save withsubmitBatch, deletion, actions with a parameter dialog, factory actions, editable composition tables, messages). The feature control goes through__OperationControl,__EntityControland__FieldControl, which the ODataModel selects itself.
D11 — Serialized ABP execution, reentrant within a LUW
- Decision: a lock per process wraps the ABP calls; it is reentrant for the LUW that holds it (a determination that runs an internal action does not block itself).
- Why: the abaplint runtime has a global state (
sy-*, static attributes). - Consequence: scaling with processes or containers.
- Implementation (M4):
RapRuntime.transactionchains the LUWs on a promise (one LUW at a time per process); the current LUW is carried byAsyncLocalStorage, which makes the EML calls of the handlers reentrant. Between processes, the locks are PostgreSQL row locks (SELECT … FOR UPDATE NOWAITon the instance of thelock master, causelockedwhen refused).
D12 — Naming and license
- Decision: packages
@open-rap/model,@open-rap/compiler,@open-rap/runtime;raptCLI; MIT license for this repository.
D13 — Test corpus of the parsers
- Initial decision: an extract of BDEF and CDS sources of the SAP-samples repositories (Apache-2.0).
- Adjustment (M1): the SAP-samples repositories were reorganized and their paths can no longer be found by code search. The corpus is therefore written for the project (
packages/compiler/test/bdef-parser.test.ts): namespaced names, operation options, static, factory and internal actions, functions, side effects,controlmappings, and the out-of-scope constructs (draft, late numbering, events…). The same sources are compared with the BDEF parser of abaplint (D1). An SAP-samples extract may be added later.
D14 — Functional scope: a complete non-draft managed RAP BO
- Decision: the target is the set of features of a managed BO without draft, tracked in FEATURES.md. It adds to the initial MVP: authorizations (global and instance), static and dynamic feature control, external numbering, static, factory, internal actions and actions with a parameter, on save determinations, precheck, side effects (CSDL), T100 messages, reads and creations by association in the ABP.
- Still out of scope, with their reason in FEATURES.md: draft (excluded by the specification, then added by D54), unmanaged implementation, late numbering, events, change documents, extensions, analytics.
with additional saveandwith unmanaged save, excluded at first, are supported since D30.
D15 — Generic runtime driven by the IR
- Decision: the generated application contains a generic runtime (
@open-rap/runtime) that readsmodel.json. Only the SQL, the CSDL, the JavaScript of the ABP, the UI and the packaging are generated. The runtime is bundled as a tarball invendor/. - Why: a single runtime tested for all BOs; a standalone output without a private registry.
- Adjustment (M6): rather than a tarball,
vendor/contains the compiledruntimeandmodelpackages (dist/and a productionpackage.json); their version carries a hash of their content, so thatnpm installupdates them after a newrapt build. The.npmrc(install-links=true) installs them as ordinary packages.server.mjscallsstart()of the runtime, configured by environment variables (.env.example).
D16 — Canonical representation of the values
- Decision: in the transactional buffer, the values are canonical JavaScript values: strings for CHAR, NUMC and STRING (trailing blanks removed); strings for decimals and INT8 (no loss of precision);
YYYY-MM-DDfor dates (initial =null);HH:MM:SSfor times; ISO 8601 UTC to the microsecond for timestamps; lower-case UUIDs with dashes; booleans forABAP_BOOLEAN. - Why: a single pivot form between ABAP, SQL and OData; the conversions are isolated and tested.
D17 — Toolchain
- Decision: TypeScript 7.0 (
strict,noUncheckedIndexedAccess,exactOptionalPropertyTypes,verbatimModuleSyntax), ESMNodeNextwith.jsspecifiers,tsccompilation todist/, Vitest (aliases to the sources), pnpm workspaces.
D18 — Database of the tests
- Decision: PGlite (PostgreSQL in WASM, in process) for the integration tests; a real PostgreSQL for the e2e.
D19 — "Shadow" DDIC for the transpiler
- Decision: the registry given to the transpiler receives the tables of the model with predefined types (DATATYPE, LENG, DECIMALS), the data elements of the standard catalog and of the project; no CDS views.
- Why: the SQL layer of the transpiler fails on associations and does not know the standard SAP data elements; the types of the ABP come from the derived interface (D2); our SQL comes from the IR.
- Consequence: a
TYPE zr_traveltype (CDS view) was not available in the ABP; the derived types and the tables were. - Adjusted (D26): the CDS entities are given as "shadow" tables with the same name and elements (predefined types, without associations), for ABAP SQL;
TYPE zr_travelis therefore typed. The shadow tables no longer have a client column (D9). The CDS views themselves stay out of the registry of the transpiler.
D20 — field ( mandatory ) without a check at runtime
- Decision: as in RAP, no runtime check;
Common.FieldControlMandatory in the CSDL and required field in the UI.mandatory : create, on the other hand, is checked on creation, as in RAP.
D21 — Triggering of the determinations and validations
- Decision: the on modify determinations run at the end of each modifying request, in successive rounds: a round handles the instances whose trigger was touched since the previous run of this determination; a determination is not triggered again by its own changes; the loop is bounded (error beyond 20 rounds). The validations and the on save determinations run in the save sequence, on the accumulated changes of the LUW.
D22 — RAP failure causes and HTTP statuses
- Decision: the first entry of
failedgives the status of the OData error:unspecific400,unauthorized403,not_found404,lockedandconflict409,readonly400,disabled409,dependency424; a missingIf-Matchon PATCH, PUT and DELETE of an entity with an ETag gives 428, a stale ETag 412. The main message is the first error message ofreported; the other messages go intodetails. Without a message, a generic text describes the cause ("Travel(…) is locked by another user"). - Why: SAP does not publish a mapping table; these statuses are those of the HTTP protocol for each cause, and Fiori elements shows the message whatever the status.
D23 — One LUW per request or per change set; responses rendered after the commit
- Decision: a modifying request (or a change set of a
$batch) is a LUW: the operations, the on modify determinations at the end of each request (D21), then the save sequence, in a PostgreSQL transaction. The responses (created entity, result of an action…) are read after the commit in the projection views; in a change set, they are deferred until the end of the change set. A failure rolls back the whole change set, which receives a single error response. - Why: the response shows the saved state (determinations, administrative fields, ETag), as in RAP, and the reads never have to see the unsaved buffer. The navigations of a write (
$1/_Booking,Travel(…)/_Booking(…)) are resolved in the LUW, which sees the instances created earlier in the change set.
D24 — Extended "clean-room" ABAP base
- Decision: in addition to
if_abap_behv,cl_abap_behavior_handlerandcl_abap_context_info, the compiler providesif_message,if_t100_message,if_t100_dyn_msg,if_abap_behv_message,cx_root(andcx_static_check,cx_dynamic_check,cx_no_check, the classes of the runtime errors),cl_system_uuid, thescx_t100keystructure and the standard data elements of the DDIC catalog. The text of an exception is its T100 message, its attributes resolved by name (native methodZRAP_EML=>exception_text). - Why: real behavior pools use message exception classes (pattern
/DMO/CM_FLIGHT_MESSAGES),cl_system_uuidand these types. The transpiler turns any class namedCX_ROOTinto a subclass of the JavaScriptError: it is enough to provide it. - Consequence: these objects are written from the public signatures of SAP (LICENSES.md); an object of the project with the same name takes precedence.
D25 — Checks of the OData interface of the writes
- Decision: the
readonlyproperties, the managed numbering properties and the administrative fields sent by an OData client are ignored (asCore.Computedprovides); an unknown property gives 400. The operations that are not exposed (use createmissing,internaloperation) give 405. The keys of an entity do not change with PATCH (400). The feature control (__EntityControl,__OperationControl,__FieldControl) is only computed when the request selects these properties (or has no$select). The global feature control ofupdate,deleteand the instance actions is also there, with the same value for all the instances: RAP presents it like the instance feature control ("consumer hint"). In the generated views, these values are read with%{…}(raw value):${…}would give the text formatted by the OData type ("1"for an Edm.Byte), and the comparison would fail. - Why: it is the behavior the ODataModel V4 of Fiori elements expects; computing the feature control calls the ABP and must not slow down the reads that do not use it.
D26 — Read ABAP SQL in the ABP
- Initial decision: any ABAP SQL statement in a behavior pool was a compile error (ABP007), for lack of a database connection for the abaplint runtime.
- Revised decision:
SELECT(simple,SINGLE,INTO TABLE,FOR ALL ENTRIES, joins, aggregates, subqueries,SELECT … ENDSELECTwithSELECT *) reads the tables and the CDS entities of the project. The writes (INSERT,UPDATE,MODIFY,DELETEon a table) are refused in the handlers (ABP007): a managed BO is written by the RAP runtime, the code changes it with EML. They are allowed in the saver (save_modified) of a BO with additional or unmanaged save (D30). Common table expressions (WITH) stay refused. - Implementation: dates as
NCHAR(8), UUIDs as 32 hexadecimal digits). The generated schema therefore adds arapt_abapschema of views, one per table (without a client column, D9) and per CDS entity, lower-case column names: datesYYYYMMDD, timesHHMMSS, UUIDs and binaries in upper-case hexadecimal, booleansX/space, timestamps as packed numbers (YYYYMMDDhhmmss.fffffff), ABAP initial values instead ofNULLs. Fixed-length character types becomebpchar, whose comparisons ignore trailing blanks like ABAP.abap.dbo.schemaPrefix(option of the abaplint runtime) makes the transpiled code read these views; that runs the query in the transaction of the current LUW, after a translation to PostgreSQL:UP TO n ROWS→LIMIT,ORDER BY PRIMARY KEY,ASCENDING, operatorsEQ/GE…,alias~field, lower-case identifiers. Only the views ofrapt_abapare readable. Each query runs in a savepoint: an SQL error leaves the transaction of the LUW usable.COMMIT WORK/ROLLBACK WORKare a runtime error, as in RAP; elements (D19):SELECT FROM zr_travelandDATA ls TYPE zr_travelare typed; other thanCOUNT(*)or of an expression: the transpiled method would fail on start. The rewriting pass declares the two most common forms (existence checkSELECT SINGLE @abap_true … INTO @DATA(x):abap_boolean;MAX( col )/MIN( col )of a single source, numbering pattern of the RAP100 tutorial: the type of the column); the others are reported at compile time (ABP009);- the SQL
@abaplint/transpilergenerates assumes columns in ABAP format (its own schemas store dates asNCHAR(8), UUIDs as 32 hexadecimal digits). The generated schema therefore adds arapt_abapschema of views, one per table (without a client column, D9) and per CDS entity, lower-case column names: datesYYYYMMDD, timesHHMMSS, UUIDs and binaries in upper-case hexadecimal, booleansX/space, timestamps as packed numbers (YYYYMMDDhhmmss.fffffff), ABAP initial values instead ofNULLs. Fixed-length character types becomebpchar, whose comparisons ignore trailing blanks like ABAP.abap.dbo.schemaPrefix(option of the abaplint runtime) makes the transpiled code read these views; - the runtime registers a read-only database client (
DatabaseClientof the abaplint runtime) that runs the query in the transaction of the current LUW, after a translation to PostgreSQL:UP TO n ROWS→LIMIT,ORDER BY PRIMARY KEY,ASCENDING, operatorsEQ/GE…,alias~field, lower-case identifiers. Only the views ofrapt_abapare readable. Each query runs in a savepoint: an SQL error leaves the transaction of the LUW usable.COMMIT WORK/ROLLBACK WORKare a runtime error, as in RAP; - the CDS entities are given to the transpiler as "shadow" tables with the same name and elements (D19):
SELECT FROM zr_travelandDATA ls TYPE zr_travelare typed; - abaplint does not type the inline declaration of the result of a literal, of an aggregate other than
COUNT(*)or of an expression: the transpiled method would fail on start. The rewriting pass declares the two most common forms (existence checkSELECT SINGLE @abap_true … INTO @DATA(x):abap_boolean;MAX( col )/MIN( col )of a single source, numbering pattern of the RAP100 tutorial: the type of the column); the others are reported at compile time (ABP009); MESSAGE … INTOtakes its texts from the message classes of the project.
- the SQL
- Semantics: as in RAP,
SELECTreads the database, not the transactional buffer: the unsaved changes of the LUW are not visible in it (read the BO with EML for that). - Why: reading control tables with SQL, the uniqueness of an identifier or numbering with
MAXare common in real behavior pools; views in ABAP format leave the SQL of the transpiler almost intact and give the ABAP semantics of the comparisons. Trade-off: a condition on a converted column (date, UUID, timestamp) cannot use an index (KNOWN_GAPS.md). - Related fix: the failure of a lock (
FOR UPDATE NOWAIT) left the PostgreSQL transaction of the LUW in an error state; it is also isolated in a savepoint (testrap-locks.test.tson a real PostgreSQL).
D27 — OpenUI5 resources served from the npm packages
- Decision: the runtime serves
/resources/from the npm packages of OpenUI5 (@openui5/*1.136, 1.154 since D121, Apache-2.0): the sources of the libraries as they are, and the themes compiled on the first request withless-openui5(Apache-2.0), then kept in memory./ui/serves the generated application. - Why: the OpenUI5 CDN is not always reachable (it is not from the development environment of this project) and a standalone application must not depend on it; npm is enough, without UI5 tooling on startup. The first load requests about 400 modules: a bundle built by the UI5 tooling (
ui5 build) is planned for the Docker image (M6).
D28 — OIDC sessions without an additional dependency
- Decision: the "authorization code" flow with PKCE is written with
jose(already used for the bearer tokens): sign-in state and session in signed cookies (HMAC-SHA256, HttpOnly, SameSite=Lax), without storage on the server; CSRF token bound to the session; discovery possible on an internal URL (OIDC_DISCOVERY_URL) distinct from the public issuer. The tests use an OIDC provider written for them (discovery, authorization, token, JWKS). - Adjustment of PLAN.md:
openid-client,@fastify/secure-sessionandoauth2-mock-serverare not added.openid-clientrequires the issuer to be the discovery URL, which does not suit Keycloak in docker-compose (the browser seeslocalhost:8180, the container of the applicationkeycloak:8080). - Consequence: the session lasts 8 hours (
maxAge); there is neither token refresh nor revocation on the server before expiry (KNOWN_GAPS.md).
D29 — End-to-end test and CI
- Decision: the e2e test (
packages/runtime/test/e2e.test.ts) starts from the compiled CLI:rapt buildof the fixture,npm installof the generated application,node server.mjson a real PostgreSQL (the one ofRAPT_E2E_DATABASE_URL, otherwise a server started for the test, otherwise PGlite), then the OData service and the UI in Chromium. The CI provides a PostgreSQL 16 service and Chromium. A second job builds the image and starts the generateddocker-compose.yml(--wait, HTTP checks of the service and of the UI). Also checked in the development environment: image built, PostgreSQL and application started by compose, creation, creation by association, action and UI served by the container. - Why: it is the delivered artifact that is tested, not the sources of the runtime.
- Note: TypeScript 7.0.2 compiles
new (x as T).Builder()without the parentheses; only the compiled JavaScript (dist) shows it, Vitest compiling the sources differently. The e2e test, which runs the dist, revealed it; the code avoids this form.
D30 — Additional and unmanaged save in a managed BO
- Decision:
managed with additional saveandmanaged with unmanaged save(header of the BDEF, orwith additional save/with unmanaged saveper entity,with full dataaccepted) are supported, with the local saver class of the behavior pool (lsc_…inheriting fromcl_abap_behavior_saverorcl_abap_behavior_saver_failed):save_modified(mandatory) andcleanup. Additional save: the runtime writes the persistent tables, then callssave_modified. Unmanaged save: the entity has no persistent table, the runtime reads and locks the instances through the CDS view andsave_modifiedwrites them. - Implementation:
TYPE REQUEST FOR DELETE; the rewriting pass declaressave_modifiedwith its parameters (create,update,delete,reported, andfailedforcl_abap_behavior_saver_failed);adjust_numbers(late numbering) is refused (ABP007); duringsave_modifiedonly. The RAP-specific forms (… FROM [TABLE] @source [INDICATORS SET STRUCTURE %control] MAPPING FROM ENTITY), which the transpiler does not know, are lowered to the kernel, which applies the mapping of the BDEF and writes with the types of the database, exact values;INSTEAD OFtrigger per table writes the table, values converted back from their ABAP form (functionsrapt_abap.to_date,to_uuid,to_timestamp…); fields;deletealso contains the compositions deleted in cascade; validation; the messages ofreportedare returned to the client; transpiler), not only those of the CDS views and of the persistent tables: a log or control table can be read and written by ABAP SQL. A table no entity uses and that cannot be built is left aside (information DDIC005).- derived types
TYPE TABLE FOR CHANGE,TYPE REQUEST FOR CHANGEandTYPE REQUEST FOR DELETE; the rewriting pass declaressave_modifiedwith its parameters (create,update,delete,reported, andfailedforcl_abap_behavior_saver_failed);adjust_numbers(late numbering) is refused (ABP007); - ABAP SQL writes are only allowed in the saver class (ABP007 elsewhere) and, at runtime, during
save_modifiedonly. The RAP-specific forms (… FROM [TABLE] @source [INDICATORS SET STRUCTURE %control] MAPPING FROM ENTITY), which the transpiler does not know, are lowered to the kernel, which applies the mapping of the BDEF and writes with the types of the database, exact values; - the other writes go through the transpiler and the views of the
rapt_abapschema (D26): anINSTEAD OFtrigger per table writes the table, values converted back from their ABAP form (functionsrapt_abap.to_date,to_uuid,to_timestamp…); - the rows of
updatecarry all the values (likewith full data),%controlthe changed fields;deletealso contains the compositions deleted in cascade; - a
failedof the saver (cl_abap_behavior_saver_failed) rolls back the LUW, like a validation; the messages ofreportedare returned to the client; - all the transparent tables of the project enter the model (database and types of the transpiler), not only those of the CDS views and of the persistent tables: a log or control table can be read and written by ABAP SQL. A table no entity uses and that cannot be built is left aside (information DDIC005).
- derived types
- Transpiler defect worked around:
DELETE dbtab FROM @wamakes it lose the row, and the query would delete the whole table: refused at compile time (ABP007) and, for safety, aDELETEwithout a condition is refused at runtime. - Why: it is the RAP way to write existing tables or to log the changes of a BO, frequent in real projects; the ABAP SQL of the saver reuses the views of D26.
D31 — Consuming remote APIs in the ABP (HTTP, OData client proxy, SCM and SCM2)
- Decision: a behavior pool can call remote APIs with the APIs of ABAP Cloud, rewritten in clean-room from their public signatures:
create_by_comm_arrangement,create_by_cloud_destination),cl_web_http_client_manager,if_web_http_client,if_web_http_request(path, query, headers, text or binary body, form, basic or bearer authentication),if_web_http_response,if_web_http_header,if_a4c_cp_service;cl_web_odata_client_factory(create_v2_remote_proxy,create_v4_remote_proxy); list read (create_by_rangeof the filters combined withand/or/not,$select,$orderby,$top,$skip,request_count,request_no_business_data), read by key (navigate_with_key), create, update (PATCH/PUT, provided properties,set_if_match), delete;cx_web_message_error,/iwbep/cx_gateway,/iwbep/cx_cp_remote(http_status_code,http_error_body), with the text of the error forget_text( ).- HTTP client:
cl_http_destination_provider(create_by_url,create_by_comm_arrangement,create_by_cloud_destination),cl_web_http_client_manager,if_web_http_client,if_web_http_request(path, query, headers, text or binary body, form, basic or bearer authentication),if_web_http_response,if_web_http_header,if_a4c_cp_service; - OData client proxy of the service consumption model:
/iwbep/cl_cp_factory_remoteandcl_web_odata_client_factory(create_v2_remote_proxy,create_v4_remote_proxy); list read (create_by_rangeof the filters combined withand/or/not,$select,$orderby,$top,$skip,request_count,request_no_business_data), read by key (navigate_with_key), create, update (PATCH/PUT, provided properties,set_if_match), delete; - exceptions
cx_http_dest_provider_error,cx_web_http_client_error,cx_web_message_error,/iwbep/cx_gateway,/iwbep/cx_cp_remote(http_status_code,http_error_body), with the text of the error forget_text( ).
- HTTP client:
- Destinations: on SAP, they come from the destination service of BTP or from a communication arrangement; the generated application reads them from its environment:
DESTINATION_<NAME>_URL, then_USERand_PASSWORD(basic),_TOKEN(bearer) or_HEADERS(JSON object: API key…).<NAME>is the name ofcreate_by_cloud_destination, or<SCENARIO>_<SERVICE_ID>then<SCENARIO>forcreate_by_comm_arrangement(comm_system_idignored). The credentials stay in the kernel: the ABAP only sees the URL.rapt buildlists the destinations named by literals in the.env.exampleand the README of the application. - Service consumption model: for its types (
tys_…,tyt_…) and its constants (gcs_entity_set,gcs_entity_type); the rewriting pass removes the definition of the model (define,def_…), written with the/iwbep/if_v4_pm_*interfaces of SAP Gateway; they are structures for the ABAP (shadow DDIC). The service definition generated for the client proxy has no binding: when there are several definitions, the one with a binding is built (SRVD007); properties. The internal ABAP names (TRAVEL_ID,'TRAVEL') are matched with the EDM names ignoring case and_(TravelID). The values are converted according to the EDM type and the ABAP type: dates, times, timestamps (/Date(ms)/in V2, ISO in V4 with the precision of the property), UUIDs, exact decimals as text (IEEE754Compatible=truein V4), booleans, binary; the trailing blanks of thecfields are not sent; the ETag (@odata.etag,__metadata.etag) fills theetagcomponent of the SCM2 classes; (X-CSRF-Token: Fetch, can be disabled withiv_do_fetch_csrf_token), session cookies kept, retry with a new token after403+X-CSRF-Token: Required, as SAP Gateway requires.- SCM2: the consumption model class (
INHERITING FROM /iwbep/cl_v4_abs_pm_model_prov) is kept for its types (tys_…,tyt_…) and its constants (gcs_entity_set,gcs_entity_type); the rewriting pass removes the definition of the model (define,def_…), written with the/iwbep/if_v4_pm_*interfaces of SAP Gateway; - SCM: the generated abstract entities (
_vcvalue control fields included) type the data; they are structures for the ABAP (shadow DDIC). The service definition generated for the client proxy has no binding: when there are several definitions, the one with a binding is built (SRVD007); - the proxy reads the
$metadataof the remote service once: entity sets, keys, types of the properties. The internal ABAP names (TRAVEL_ID,'TRAVEL') are matched with the EDM names ignoring case and_(TravelID). The values are converted according to the EDM type and the ABAP type: dates, times, timestamps (/Date(ms)/in V2, ISO in V4 with the precision of the property), UUIDs, exact decimals as text (IEEE754Compatible=truein V4), booleans, binary; the trailing blanks of thecfields are not sent; the ETag (@odata.etag,__metadata.etag) fills theetagcomponent of the SCM2 classes; - modifying requests: CSRF token requested with
HEADon the root of the service (X-CSRF-Token: Fetch, can be disabled withiv_do_fetch_csrf_token), session cookies kept, retry with a new token after403+X-CSRF-Token: Required, as SAP Gateway requires.
- SCM2: the consumption model class (
- Implementation: the ABAP keeps the state of the objects (request, headers, filters); the kernel (
ZRAP_EML) makes the network calls (fetchof Node.js, 60 s by default ori_timeout), reads the$metadata(fast-xml-parser, already used by the compiler) and converts the values. - Why: calling an API from an action, a determination or a validation is a common need (side-by-side extension, enrichment, check against another system); the developer keeps the code they write on SAP. The SAP Gateway classes do not exist outside an SAP system: they are reimplemented, without SAP code.
- Tests:
rap-variant-remote.test.ts(REST API: destination with basic auth, headers, status, missing destination, refused connection; OData V4 with an SCM2 class to the application of the fixture served on a port: filter,$select,$orderby,$top,$count, read by key; V4 writes to a simulated service: CSRF, cookies, ETags, token renewal, 409 error; OData V2 with the abstract entity of an SCM:d.results,__count,/Date()/),http-client.test.ts,app-scaffold.test.ts.
D32 — Dependent ETag and ETag in a change set
- Decision: an
etag dependent by _Assocentity has the ETag of its master: the ETag is the value of the ETag field of the master instance reached through thebyassociations (one or several, up to anetag master). The service exposes it (@odata.etagof the instances,ETagheader,Core.OptimisticConcurrencywith the path_Travel/LocalLastChangedAt) and checksIf-Matchon the changes of the dependent entity (428 without the header, 412 when stale). - The master changes with its dependents: the SAP rule is that the ETag field is updated on each change of the instance it covers; when a dependent instance is created, changed or deleted, the runtime updates the ETag field of the master when it manages it (administrative timestamp
localInstanceLastChangedAtorlastChangedAt, master written by the runtime), once per LUW, at save time. A master with unmanaged save or with another ETag field must be updated by the application. If-Matchin a change set: it is compared with the ETag of the instance at the beginning of the LUW, the state the client read. The requests of a change set carry the ETags read before it: an earlier change in the same change set (the previous request, or a determination that recomputes the travel when a booking changes) does not make them stale. The changes of the other clients are still detected: the LUW locks the instances it changes.- Why: without it, the Object Page of a non-draft BO that saves a travel and its bookings in one change set would fail with 412 as soon as a determination touches the travel; and a dependent entity would have no concurrency protection.
- Implementation: OData model (
etagPath), CSDL, read (scalar subqueries along the navigations, in the lists, the single reads and$expand), write check (Transaction.etagValue), update of the master (refreshEtagMasters, before the write). Tests:rap-variant-etag.test.ts.
D33 — PGlite and Keycloak proven end to end
- PGlite (
PGLITE_DIR): the e2e test starts the generated application on its embedded database, creates a travel, stops it and starts it again: the schema is applied again (idempotent) and the data is there. The test revealed that the application did not start on PGlite: the schema was sent as one query of several statements, which the extended protocol of PGlite refuses (cannot insert multiple commands into a prepared statement). It is now split into statements (splitStatements: literals, identifiers,$f$…$f$bodies and comments respected) and applied in a transaction. - Keycloak:
keycloak.test.tsplays the browser against a real Keycloak with the generated realm: redirect to Keycloak, submission of the sign-in form ofalice, return to/auth/callback(authorization code with PKCE), session on the UI and on the OData service (CSRF token, creation attributed toALICE), sign-out to the end-session endpoint of Keycloak; then a bearer token issued by Keycloak (public client created through the admin API, password grant) verified by the JWKS, and a forged token refused. Run against the Keycloak 26.8.2 distribution (Maven Central, Java 21) in the development environment, and in CI against the image of the generateddocker-compose.yml(--profile oidc). - CI: the health check of the PostgreSQL service uses
pg_isready -U postgres.
D34 — Authorizations: authorization objects, OIDC roles, AUTHORITY-CHECK
- Problem: the ABAP environment splits the authorizations between the IAM (IAM apps, business catalogs, business roles with their restrictions, assigned to business users) and the code (
AUTHORITY-CHECKin the handlers, DCL access controls). Outside SAP, there is no IAM; OIDC authenticates and carries roles, but does not say which values of authorization objects a role grants. The transpiler translatesAUTHORITY-CHECKinto a call to a kernel classKERNEL_AUTHORITY_CHECKthe application did not provide: the statement compiled but failed at runtime (500). - Decision:
TACTZ), or from theobjectssection of the roles file; with the sources (outside thesrc/folder, abapGit ignores it): name of the role of the IdP → authorizations, instances of objects with their values, like a business role and its restrictions; a claim of the token ({claim:agency}: the agency of the user, attribute of the IdP), so as not to create one role per value;sy-subrc0 when an authorization of the object accepts all the checked fields (DUMMYis not checked), 4 otherwise, 12 without an authorization for the object, 40 forFOR USERof another user; the ABAP code stays the one of SAP; (OIDC_ROLES_CLAIM) and carries the attributes; the application keeps the claims read by the roles (session included);OIDC_REQUIRED_ROLEstays the right to access the application; development system), unlessDEV_ROLES(andDEV_ATTRIBUTES) are given;AUTHORIZATIONS_FILEreplaces the roles on deployment;AUTHORITY-CHECKs of the code (ABP010, ABP011); the generated Keycloak realm contains the roles (given toalice), a user attribute declared in the profile and a mapper to the token for each claim read.- the authorization objects come from the abapGit sources (SUSO: fields
FIEL1…, activitiesTACTZ), or from theobjectssection of the roles file; - the roles are in
rapt/authorizations.json, at the root of the abapGit project, versioned with the sources (outside thesrc/folder, abapGit ignores it): name of the role of the IdP → authorizations, instances of objects with their values, like a business role and its restrictions; - values in the PFCG way: value, pattern
07*,*, range{ "from", "to" }, and values from a claim of the token ({claim:agency}: the agency of the user, attribute of the IdP), so as not to create one role per value; AUTHORITY-CHECKis evaluated by the kernel on the roles of the user of the request:sy-subrc0 when an authorization of the object accepts all the checked fields (DUMMYis not checked), 4 otherwise, 12 without an authorization for the object, 40 forFOR USERof another user; the ABAP code stays the one of SAP;- the IdP (Keycloak, Entra ID, SAP Cloud Identity Services…) assigns the roles to the users (
OIDC_ROLES_CLAIM) and carries the attributes; the application keeps the claims read by the roles (session included);OIDC_REQUIRED_ROLEstays the right to access the application; - in development (
AUTH_MODE=none), the user has all the authorizations (like SAP_ALL in a development system), unlessDEV_ROLES(andDEV_ATTRIBUTES) are given;AUTHORIZATIONS_FILEreplaces the roles on deployment; - the compiler checks the roles against the objects (AUTH001…AUTH004) and the
AUTHORITY-CHECKs of the code (ABP010, ABP011); the generated Keycloak realm contains the roles (given toalice), a user attribute declared in the profile and a mapper to the token for each claim read.
- the authorization objects come from the abapGit sources (SUSO: fields
- Why: the same behavior pool runs on SAP and here; the definition of the roles stays reviewed and versioned like the IAM objects; the administration of the users stays in the IdP.
- Fixture: the reference BO checks the
ZAO_TRAVLobject (activity, agency) in its global and instance authorizations, like the /DMO/ reference scenario of SAP; rolestravel_manager,travel_agent(agency from theagencyclaim),travel_viewer. - Tests:
rap-authorizations.test.ts(locally signed tokens),authorizations.test.ts(semantics ofsy-subrc),authorizations.test.tsof the compiler (diagnostics),keycloak.test.ts(an agent created in Keycloak with their agency attribute).
D35 — Access controls (DCL) on the reads
- Decision: the CDS roles of the abapGit sources (DCLS objects:
define role R { grant select on E where … ; }) restrict the rows the OData service returns to the user of the request, in the lists,$count, the single reads,$expandand the navigations. A row is granted when a condition of a role of the entity is true; an entity without a role is fully readable (as in ABAP CDS). - Evaluated conditions:
( E1, E2 ) = aspect pfcg_auth( OBJ, F1, F2, ACTVT = '03' )on the authorizations of the user (D34: values, patterns, ranges, claims; no authorization → no row),E ?= aspect user/= aspect user(ABAP name of the user), comparisons with literals (ABAP format: datesYYYYMMDD),like,is [not] null,and,or,not, parentheses, paths of a to-one association (_Travel.AgencyID, read by a subquery on the target view) andinheriting conditions from entity B: a projection takes the conditions of its base view, its elements renamed as it exposes them. - Security: what cannot be evaluated (other aspects, longer paths, element not exposed by the projection) grants nothing (deny by default), with a diagnostic (DCL002, DCL003). A read outside a request grants nothing. The development user without
DEV_ROLESis not restricted. - What is not filtered: the EML and the ABAP SQL of the behavior pool (like
WITH PRIVILEGED ACCESS); the changes go through the instance authorization, as in RAP. - Implementation: DCL parser (
dcl/parser.ts), resolution for the exposed entities (ir/access-controls.ts, conditions inmodel.accessControls), SQL condition computed per request (odata/access.ts, user carried by anAsyncLocalStorage) and added to theWHEREof the read engine. - Fixture: roles
ZRT_R_TRAVEL(agency throughpfcg_auth( ZAO_TRAVL, ZAGENCY, ACTVT = '03' )),ZRT_C_TRAVEL(inherits from the base view),ZRT_C_BOOKING(agency of the travel,_Travel.AgencyID).
D36 — Authorizations in the consumer hints (UI)
- Decision: like RAP, which presents the feature control and the authorization check as consumer hints, the entities whose BO has authorization handlers (master with a global or instance handler, or entity dependent on such a master) expose
__EntityControl(Updatable,Deletable) and__OperationControl(instance actions, create by association); their values combine, for the user of the request, the feature controls and the global and instance authorizations. The$metadataannounces them (UpdateRestrictions,DeleteRestrictions,NavigationRestrictionsper path,Core.OperationAvailable), usable by a Fiori elements application as well. - Creation: it depends on no instance; the service answers
GET <root>$permissions(creations allowed per entity set: global authorization and global feature control) and the generated UI hides Create when it is refused. - Create by association: for the master entity, it has its own indicator (
%assoc-_Booking), as on SAP; for a dependent entity, the update authorization of the master applies. The fixture grants the creation of bookings with the update of the travel. Corrected by D85: SAP has no%associn the authorization types, the creation by association is authorized as an update of its source. - Tests:
rap-authorizations.test.ts(checks per profile,$permissions, creation of bookings),ui-authorizations.test.ts(browser: a viewer does not see Create, Edit, Delete and the action are disabled).
D37 — Launchpad of the applications (OpenUI5)
- Decision:
rapt launchpad <launchpad.json> --out <folder>generates a launchpad, the equivalent of the SAP Fiori launchpad built with OpenUI5. The SAP shell (sap.ushell) only exists in SAPUI5, under an SAP license, and the rule of the project excludes it. The launchpad is made of asap.f.ShellBar(home, tile search, user menu with sign-out) and of groups ofsap.m.GenericTile. A dynamic tile (NumericContent) shows the$countof an entity set, with an optional filter. Navigation is by intent (/#Travel-manage,/go/Travel-manage?…). - Content:
launchpad.jsonis versioned with the sources, like the content of the launchpad (catalogs, groups, tiles, target mappings). It lists the applications (folder generated byrapt build, internal URL) and the groups of tiles. A tile is assigned to roles of the IdP, the equivalent of the business catalog of a business role; without a role, every user sees it. The compiler resolves the service paths and checks the entity sets of the counters, the intents and the roles (LPD001toLPD007); it takes the roles and the claims of the applications for the realm and the session. - Architecture, a single origin: the SAP front-end server serves the launchpad, the applications and their services under one domain. Here, the server of the launchpad mounts the UI of each application under
/apps/<id>/and relays its services at their own paths (/sap/opu/odata4/…, unique per service); the redirects of the applications are rewritten under their mount point. The browser sees a single origin: no CORS, the UI reads the counters directly, the cookies are shared. - Single sign-on: the launchpad opens the OIDC session (code + PKCE). The applications behind it have the same
SESSION_SECRET(and the client andPUBLIC_URLof the launchpad) and read this session: user, roles, claims read by their authorizations. Each application keeps its authorizations (D34), its access controls (D35) and its required role, now checked on each request: a session opened by the launchpad for a user without this role receives a 403. The bearer tokens of the API clients are relayed as is. - Sign-out: the ID token of the sign-in is kept in a separate HttpOnly cookie (
rapt_idt) and passed asid_token_hintto the end-session endpoint. The provider then ends its session without a confirmation page, even with an expired token, as OIDC RP-Initiated Logout provides (checked with Keycloak). This also applies to a standalone application. - Why not the relayed token (BFF): relaying the access token of the user would have required keeping the tokens on the server and refreshing them (5 minutes by default with Keycloak). The shared signed session stays stateless, like the one of the applications (D28).
- In the applications: the generated UI, served behind a launchpad (
/launchpad/configanswers), shows the shell bar of the launchpad above its pages (home, user, sign-out). Alone, it is unchanged. Each application stays deployable on its own. - Operations: the generated folder contains
server.mjs, a Dockerfile and adocker-compose.yml: the launchpad, each application built from its folder with its PostgreSQL database, and Keycloak in theoidcprofile (clientrapt-launchpad). Plus.env.example(APP_<ID>_URL) and a README. - Tests:
runtime/test/launchpad.test.tscovers the tiles per role and the sign-in against a test OIDC provider, then the reading of the session by the application. It also checks, through the gateway, the DCL, the authorizations, the CSRF and the bearer tokens, as well as the intents, the rewriting of the redirects, the 502 and the required role.runtime/test/launchpad-ui.test.tstests in the browser the tiles of a viewer, the counter, the search, the application opened with the shell bar, the way back and the intent.compiler/test/launchpad.test.tscovers the diagnostics, the generated files and the CLI.
D38 — Development loop (rapt dev)
- Context: building, installing and starting the generated application takes four commands (
rapt build,npm install, a PostgreSQL database,npm start) at each change of a source. The standalone application is the target: the editing loop must be immediate. - Decision:
rapt dev <src>builds the application without its scaffold (novendor/, nopackage.json, no Docker) into<src>/.rapt/dev, starts it, watches the sources and starts again on each change (grouped over 150 ms, one build at a time). of the@open-rap/runtimepackage, which contains the abaplint runtime, PGlite and OpenUI5. The transpiled ABAP module and the runtime thus load the same@abaplint/runtime. No npm installation. IPC message (PGlite closes its files) then started again. The transpiled ABAP code sets a global state (theabapobject) and ES modules cannot be unloaded: a restart in the same process would keep the old behavior pool. format ofrapt check. remembered; when it changes, the database is deleted and created again (development data, no migration). WithDATABASE_URL, the given database is used as is. of Node.js loses the files replaced by a rename, which most editors do on save. Folders starting with a dot andnode_modulesare ignored, except.abapgit.xml. variable overrides them.- Dependencies: the
node_modulesof the build is a link (a junction on Windows) to the one of the@open-rap/runtimepackage, which contains the abaplint runtime, PGlite and OpenUI5. The transpiled ABAP module and the runtime thus load the same@abaplint/runtime. No npm installation. - Child process: the server runs in a separate process (
dev-server.mjs), stopped by an IPC message (PGlite closes its files) then started again. The transpiled ABAP code sets a global state (theabapobject) and ES modules cannot be unloaded: a restart in the same process would keep the old behavior pool. - Errors: a build in error does not touch the running application; the diagnostics keep the format of
rapt check. - Database: PGlite in
.rapt/dev/data, kept between builds. The applied schema is remembered; when it changes, the database is deleted and created again (development data, no migration). WithDATABASE_URL, the given database is used as is. - Watching: one
fs.watchper folder, not the recursive mode. On Linux, the recursive mode of Node.js loses the files replaced by a rename, which most editors do on save. Folders starting with a dot andnode_modulesare ignored, except.abapgit.xml. - Defaults:
AUTH_MODE=none,HOST=127.0.0.1,LOG_LEVEL=warn; each environment variable overrides them.
- Dependencies: the
- Tests:
compiler/test/dev.test.tscovers the build, the behavior pool run, the data kept, the build in error, the reset on a schema change and the watching of a file replaced by a rename.
D39 — JSON output of the CLI and VS Code extension
- Context: everything must be possible on the command line, or visually in VS Code. Two implementations of the compiler would diverge.
- Decision: the CLI stays the only engine; the VS Code extension (packages/vscode) calls it and shows its results.
counts,diagnosticswith, in addition tofile, the absolute pathpath);rapt buildaddsoutandfiles.rapt devwrites one JSON event per line (building,changed,diagnostics,ready,failed,database-reset,server-failed,server-stopped,error,logfor the logs of the server). The text ofrapt devis derived from the same events (formatDevEvent). on the project), commands Check the BO, Build the application, Start / Stop rapt dev, Open the application, state in the status bar, menus of the explorer and of the title bar. A project is the folder of.abapgit.xml(otherwise, the parent ofsrc). of the repository (pnpm pack) installed by npm, flat, with their production dependencies and whatrapt devserves (OpenUI5,less-openui5, PGlite, at the versions of the runtime), without source maps, types, documentation, tests of the packages, OpenUI5 design time nor PGlite extensions (scripts/stage-rapt.mjs). A download on first start would have made the.vsixlighter, but required access to the npm registry (often filtered in companies) and cache code; the.vsixgoes through VS Code, offline once installed, and rapt always has the version of the extension. (Node.js 22 since VS Code 1.101, minimum version of the extension); the server ofrapt devinherits the variable. Checked with Electron 37:check,dev, PGlite, behavior pool, stop of the server whenrapt devis killed. from the runtime to the root, that contains@abaplint/runtime(the one of the runtime in the pnpm repository, the one ofrapt/in the extension). clone or anode_modulesof the workspace, otherwiseraptfrom the PATH; Node.js fromrapt.nodePath, otherwise the one of VS Code. publishes the.vsixas an artifact (open-rap-runtime-vscode). server stops when its IPC channel withrapt devcloses (D38). (dist/extension.cjs,vscodeexternal), without a runtime dependency;.vsixbyvsce package.--json:rapt checkandrapt buildwrite a JSON object (command,ok,root,counts,diagnosticswith, in addition tofile, the absolute pathpath);rapt buildaddsoutandfiles.rapt devwrites one JSON event per line (building,changed,diagnostics,ready,failed,database-reset,server-failed,server-stopped,error,logfor the logs of the server). The text ofrapt devis derived from the same events (formatDevEvent).- Extension: diagnostics in the Problems tab (on each save, or from
rapt devwhen it runs on the project), commands Check the BO, Build the application, Start / Stop rapt dev, Open the application, state in the status bar, menus of the explorer and of the title bar. A project is the folder of.abapgit.xml(otherwise, the parent ofsrc). - Standalone extension: the
.vsix(~31 MB, ~9,100 files) containsrapt/: the packages of the repository (pnpm pack) installed by npm, flat, with their production dependencies and whatrapt devserves (OpenUI5,less-openui5, PGlite, at the versions of the runtime), without source maps, types, documentation, tests of the packages, OpenUI5 design time nor PGlite extensions (scripts/stage-rapt.mjs). A download on first start would have made the.vsixlighter, but required access to the npm registry (often filtered in companies) and cache code; the.vsixgoes through VS Code, offline once installed, and rapt always has the version of the extension. - Node.js of VS Code: rapt runs on the executable of VS Code with
ELECTRON_RUN_AS_NODE=1(Node.js 22 since VS Code 1.101, minimum version of the extension); the server ofrapt devinherits the variable. Checked with Electron 37:check,dev, PGlite, behavior pool, stop of the server whenrapt devis killed. rapt devinstalled flat: thenode_moduleslinked in.rapt/devis the first folder, from the runtime to the root, that contains@abaplint/runtime(the one of the runtime in the pnpm repository, the one ofrapt/in the extension).- CLI found:
rapt.cliPathsetting, otherwise the bundled rapt, otherwise an Open RAP Runtime clone or anode_modulesof the workspace, otherwiseraptfrom the PATH; Node.js fromrapt.nodePath, otherwise the one of VS Code. - CI: the
testjob builds the.vsix, checks the fixture with the bundled rapt and publishes the.vsixas an artifact (open-rap-runtime-vscode). - Stopping
rapt dev: SIGINT. On Windows, where this signal terminates the process, the server stops when its IPC channel withrapt devcloses (D38). - Build: ESM sources checked by
tsc, delivered as one CommonJS file by esbuild (dist/extension.cjs,vscodeexternal), without a runtime dependency;.vsixbyvsce package.
- Tests:
vscode/test/rapt.test.tscovers the search of the project and of the CLI, the reading of the JSON lines,rapt check --jsonandrapt dev --jsonreally started.compiler/test/cli.test.tsanddev.test.tscover the JSON output and the events. The interface of the extension (commands, status bar) is not tested in VS Code.
D40 — ABAP Cloud utility classes in the behavior pool
- Context: after the HTTP client (D31), the behavior pools need the other commonly used released classes: JSON for the APIs, encodings, numbering, dates, application log, hashing, random numbers, regular expressions, RTTS. Without them, ordinary ABAP Cloud code does not pass the check.
- Decision: a clean-room implementation in ABAP of these classes (
gen/abap/framework-utils.ts), written from the public signatures documented by SAP, with methods of theZRAP_EMLkernel for what ABAP cannot do alone (runtime/src/abap/utils.ts). Guide: UTILITIES.md. given to the transpiler. A project that uses none of them keeps the same build and the same check time; an object of the project with the same name wins.@abaplint/runtimeby type, names of the members according to the mode), code pages, base64, gzip (zlib), hashing and HMAC (crypto), random seed, regular expressions (RegExp withdfor the submatches, extended mode and POSIX classes translated), calendar and timestamps in tenths of a microsecond (BigInt), description of a data object for the RTTS. The RTTS are built in ABAP, one level at a time:ASSIGN COMPONENTfor the structures,CREATE DATA … LIKE LINE OFfor the tables.db/schema.sqlwithout touching the current number; tablerapt_number_range, written in the LUW (the LUWs are serialized: no conflict). An interval that is not configured starts at 1, to develop without configuration. LUW; read by filter. (model.services), so as not to change the schema of the other applications.submatch_result(_tab)as DDIC objects (TABL, TTYP), and anABAPtype pool (abap_compdescr_tab,abap_component_tab…), which the analysis of abaplint resolves. utilities therefore do not callZRAP_EML(cl_abap_char_utilitieswrites its control characters as literals).- Closure: only the objects named by the sources of the project, then those they name, are given to the transpiler. A project that uses none of them keeps the same build and the same check time; an object of the project with the same name wins.
- The kernel: JSON (parser that keeps the numbers as written, traversal of the data of
@abaplint/runtimeby type, names of the members according to the mode), code pages, base64, gzip (zlib), hashing and HMAC (crypto), random seed, regular expressions (RegExp withdfor the submatches, extended mode and POSIX classes translated), calendar and timestamps in tenths of a microsecond (BigInt), description of a data object for the RTTS. The RTTS are built in ABAP, one level at a time:ASSIGN COMPONENTfor the structures,CREATE DATA … LIKE LINE OFfor the tables. - Numbering: intervals of
rapt/number-ranges.json(diagnostic NR001), inserted bydb/schema.sqlwithout touching the current number; tablerapt_number_range, written in the LUW (the LUWs are serialized: no conflict). An interval that is not configured starts at 1, to develop without configuration. - Application log: tables
rapt_application_logandrapt_application_log_item, in the LUW; read by filter. - Tables: generated only when the code uses
cl_numberrange_runtimeorcl_bali_*(model.services), so as not to change the schema of the other applications. - Global types:
string_table,xstring_table,match_result(_tab),submatch_result(_tab)as DDIC objects (TABL, TTYP), and anABAPtype pool (abap_compdescr_tab,abap_component_tab…), which the analysis of abaplint resolves. - Class constructors: they run when the modules are loaded, before the kernel; those of the utilities therefore do not call
ZRAP_EML(cl_abap_char_utilitieswrites its control characters as literals).
- Tests:
runtime/test/utilities.test.tsruns a self-test written in ABAP in a behavior pool (test/utilities/selftest.abap: more than seventy checks on all the classes, including the reference values of SHA-256, MD5 and HMAC), draws numbers until an interval is exhausted and writes then reads a log.compiler/test/utilities.test.tscovers the closure, the check of all the classes andrapt/number-ranges.json.
D41 — Background processing (bgPF) and e-mail
- Context:
cl_bgmc_process_factoryandcl_bcs_mail_messageare commonly used in RAP BOs (deferred work after the save, notifications). Both rely on the LUW: the process only starts and the mail only leaves after theCOMMIT WORK. - Decision: the runtime keeps, for each LUW, the work to do after its commit (
LuwContext.afterCommit). A rolled-back LUW forgets it; a committed LUW starts it after the response (setImmediate), each item in a LUW of its own, serialized with the others. LUW and keeps the reference of the ABAP operation. The execution callsexecutein a LUW marked "background": controlled (if_bgmc_op_single), the EML is saved at the end and ABAP SQL writes aftercl_abap_tx=>save( ); uncontrolled, ABAP SQL always writes,COMMIT ENTITIESstarts the save sequence (once) andROLLBACK ENTITIESrolls back the LUW. Outside the background,COMMIT ENTITIESstays refused in a behavior pool. The final state (SUCCESSFUL,ERRONEOUSwith the text of the exception) is written in a separate LUW, to survive the rollback of the one of the operation. Serializing an object of the abaplint runtime (references, nested objects) would require a general mechanism; the application being a single process, the reference is enough. Limit: a process not run at shutdown is not resumed.rapt_mail(WAITING), then sends it after the commit through the server ofMAIL_SMTP_URL(SENT/ERROR). Without a server, the mail stays in the table (STORED) with its complete message: development needs no server.MAIL_FROMgives the default sender; both variables are in the.env.exampleof the applications that send mails.cl_bcs_mail_message(model.services, D40).- bgPF:
save_for_executionwrites the process (rapt_background_process,NEW) in the LUW and keeps the reference of the ABAP operation. The execution callsexecutein a LUW marked "background": controlled (if_bgmc_op_single), the EML is saved at the end and ABAP SQL writes aftercl_abap_tx=>save( ); uncontrolled, ABAP SQL always writes,COMMIT ENTITIESstarts the save sequence (once) andROLLBACK ENTITIESrolls back the LUW. Outside the background,COMMIT ENTITIESstays refused in a behavior pool. The final state (SUCCESSFUL,ERRONEOUSwith the text of the exception) is written in a separate LUW, to survive the rollback of the one of the operation. - Why in memory: SAP serializes the operation object to run it later, elsewhere. Serializing an object of the abaplint runtime (references, nested objects) would require a general mechanism; the application being a single process, the reference is enough. Limit: a process not run at shutdown is not resumed.
- E-mail:
send( )composes the MIME message with nodemailer (MIT-0), keeps it inrapt_mail(WAITING), then sends it after the commit through the server ofMAIL_SMTP_URL(SENT/ERROR). Without a server, the mail stays in the table (STORED) with its complete message: development needs no server.MAIL_FROMgives the default sender; both variables are in the.env.exampleof the applications that send mails. - Tables: generated only if the code uses
cl_bgmc_process_factoryorcl_bcs_mail_message(model.services, D40).
- bgPF:
- Tests:
runtime/test/background.test.ts: an action starts three processes (controlled with EML, uncontrolled withCOMMIT ENTITIES, failing) and checks their states and effects; another sends a mail (HTML, copy, text and binary attachments), kept without a server, sent to a test SMTP server withMAIL_SMTP_URL, and nothing is sent when the LUW is rolled back.
D42 — Writing only ABAP: tables as source, rapt abapgit, rapt new, initial data
- Context: an abapGit export requires, for each object, an XML metadata file, and the tables only exist as XML (DD02V, DD09L, DD03P). Writing these files by hand discourages a developer who wants to write their BO in VS Code without an SAP system.
- Decision: Development Tools (
define table … { key client : abap.clnt not null; … }, annotations@EndUserText.label,@AbapCatalog.*,@Semantics.amount.currencyCode/@Semantics.quantity.unitOfMeasurefor the references,include,define structure).loadProjectderives the abapGit XML from it in memory: the rest of the compiler only reads the XML, and the diagnostics of the tables carry the line of the field in the source. The source wins over an XML next to it. Foreign keys (with foreign key) are reported (TABL002) and not carried over. SAP system:.abapgit.xml(which ignores*.astabl, unknown to abapGit),package.devc.xml, the XML of the tables written as source (regenerated each time), and the missing XML of the CDS entities (source type derived: view, projection, abstract entity, custom entity…), metadata extensions, access controls, BDEF, SRVD, classes and interfaces (description from@EndUserText.labelor from the ABAP Doc short text). An existing XML is never changed.--checkonly reports what is missing (exit code 1), for the CI. activatable on SAP: table as source, root view and projection, metadata extension (List Report and Object Page), BDEF and projection, behavior pool (global authorization, one determination), SRVD and SRVB OData V4,rapt/seed.json,.gitignore(.rapt/,node_modules/), then the XML files ofrapt abapgit. Existing files are never overwritten. Command RAP: New business object in the extension. case, without the client) andrapt/seed.sql, checked at compile time (SEED001, SEED002) and copied intodb/of the application. WithSEED=auto(default ofrapt dev), the application loads them on its first start, when all its tables are empty: a missing UUID key is drawn at random, a NUMC receives its leading zeros. WithoutSEED=auto(in production by default), nothing is loaded.- Tables as source:
name.tabl.astabl, with the syntax of the table editor of the ABAP Development Tools (define table … { key client : abap.clnt not null; … }, annotations@EndUserText.label,@AbapCatalog.*,@Semantics.amount.currencyCode/@Semantics.quantity.unitOfMeasurefor the references,include,define structure).loadProjectderives the abapGit XML from it in memory: the rest of the compiler only reads the XML, and the diagnostics of the tables carry the line of the field in the source. The source wins over an XML next to it. Foreign keys (with foreign key) are reported (TABL002) and not carried over. rapt abapgit <src>writes what is missing for abapGit to import the repository into an SAP system:.abapgit.xml(which ignores*.astabl, unknown to abapGit),package.devc.xml, the XML of the tables written as source (regenerated each time), and the missing XML of the CDS entities (source type derived: view, projection, abstract entity, custom entity…), metadata extensions, access controls, BDEF, SRVD, classes and interfaces (description from@EndUserText.labelor from the ABAP Doc short text). An existing XML is never changed.--checkonly reports what is missing (exit code 1), for the CI.rapt new <src> <Entity> [--prefix ZRT] [--description …]writes a complete managed BO, activatable on SAP: table as source, root view and projection, metadata extension (List Report and Object Page), BDEF and projection, behavior pool (global authorization, one determination), SRVD and SRVB OData V4,rapt/seed.json,.gitignore(.rapt/,node_modules/), then the XML files ofrapt abapgit. Existing files are never overwritten. Command RAP: New business object in the extension.- Initial data:
rapt/seed.json(table → rows, field names of the dictionary, in lower case, without the client) andrapt/seed.sql, checked at compile time (SEED001, SEED002) and copied intodb/of the application. WithSEED=auto(default ofrapt dev), the application loads them on its first start, when all its tables are empty: a missing UUID key is drawn at random, a NUMC receives its leading zeros. WithoutSEED=auto(in production by default), nothing is loaded.
- Tables as source:
- Why not a "source-less" XML: abapGit can only serialize tables as XML; the
.astablsource is what an ADT developer already reads and writes, and the conversion to XML is deterministic. Keeping both files in the repository (the XML regenerated byrapt abapgit) allows the import into SAP without a tool. - Tests:
compiler/test/authoring.test.ts(the source ofzrt_bookinggives the same XML and the same model as the fixture; positioned errors;rapt abapgitrecreates the XML files removed from the fixture identically;rapt newproduces a BO that compiles without a diagnostic) andruntime/test/seed.test.ts.
D43 — Custom entities (unmanaged query) and managed BO on a custom entity
- Context: the data of a BO sometimes comes from APIs, not tables. ABAP Cloud exposes it with a custom entity (
define custom entity) whose query class (@ObjectModel.query.implementedBy: 'ABAP:<class>', interfaceif_rap_query_provider) provides the rows. - Decision: query class, its typed elements and its associations (
_X : association … to … on …). The OData reads (collection, instance, navigation,$count, one-level$expand, to or from a custom entity) callselectwith the request of ABAP Cloud: filter as an ABAP SQL string (get_as_sql_string) and as ranges (get_as_ranges,cx_rap_query_filter_no_rangewhen the filter does not fit), sorting, paging (get_paging), requested elements,is_total_numb_of_rec_requested,is_data_requested, search.set_dataandset_total_number_of_recordsgive the result back to the runtime (kernelzrap_eml=>query_data,query_total). As in SAP, the class applies the filter, the sorting and the paging itself; the runtime only guarantees the keys and the navigation conditions (extra rows dropped) and cuts the page at$top. The interfaces and classes of the query are written from their public signatures (D24). BDEF027): the RAP runtime reads the instances (READ ENTITIES, existence check, ETag, associations) through the query class, with a filter on the keys, in the current LUW;save_modifiedwrites the changes to the API. No database lock: the LUWs of the application are serialized. On SAP, the same need is handled by an unmanaged BO.- Custom entity (activatable on SAP): the model keeps it without an SQL view, with its query class, its typed elements and its associations (
_X : association … to … on …). The OData reads (collection, instance, navigation,$count, one-level$expand, to or from a custom entity) callselectwith the request of ABAP Cloud: filter as an ABAP SQL string (get_as_sql_string) and as ranges (get_as_ranges,cx_rap_query_filter_no_rangewhen the filter does not fit), sorting, paging (get_paging), requested elements,is_total_numb_of_rec_requested,is_data_requested, search.set_dataandset_total_number_of_recordsgive the result back to the runtime (kernelzrap_eml=>query_data,query_total). As in SAP, the class applies the filter, the sorting and the paging itself; the runtime only guarantees the keys and the navigation conditions (extra rows dropped) and cuts the page at$top. The interfaces and classes of the query are written from their public signatures (D24). - Managed BO with unmanaged save on a custom entity (specific to Open RAP Runtime, warning BDEF027): the RAP runtime reads the instances (READ ENTITIES, existence check, ETag, associations) through the query class, with a filter on the keys, in the current LUW;
save_modifiedwrites the changes to the API. No database lock: the LUWs of the application are serialized. On SAP, the same need is handled by an unmanaged BO.
- Custom entity (activatable on SAP): the model keeps it without an SQL view, with its query class, its typed elements and its associations (
- Why: it is the ABAP Cloud way to read an API; the managed BO on the custom entity avoids writing by hand the transactional buffer of an unmanaged BO, at the price of an accepted and reported gap.
- Tests: fixture
fixtures/custom-entity(products read from an "API" simulated by a table, reviews as constants);runtime/test/custom-entity.test.ts(ranges, sorting, paging, count, navigation,$expand, refused filter, creation, duplicate, validation, change, deletion) andcompiler/test/custom-entity.test.ts.
D44 — SAP standard views (I_Currency…) and value helps
- Context: on SAP (ABAP Cloud as well as S/4HANA), the released CDS views
I_Currency,I_UnitOfMeasure,I_Country,I_Languageand their text views exist in every system, with content delivered and maintained by SAP (ISO currencies, units, countries, languages). A RAP BO uses them for its value helps (@Consumption.valueHelpDefinition) and its associations. Without them, a source activatable on SAP failed here (CDS005) and the value help was ignored. - Decision: it receives it, with its text view (
_Text, category#TEXT) and its tables (rapt_currency,rapt_currencyt,rapt_uom,rapt_uomt,rapt_country,rapt_countryt,rapt_language,rapt_languaget). The elements have the SAP names; the tables are specific to Open RAP Runtime (ABAP Cloud code does not read the SAP tables). A view defined by the project wins. The files are virtual (<standard>/…):rapt abapgitnever writes them. (three-letter code, currency, EU membership), common units (SAP code, ISO code, dimension), languages (one-character SAP key, ISO code); texts in English.db/schema.sqlinserts them (ON CONFLICT DO NOTHING): a row added or changed by the application stays. The standard tables do not count for "all the tables are empty" of the initial data (D42). implicitly by the service, read-only, without a page in the UI.$metadatacarriesCommon.ValueList(CollectionPath,InOutparameter,DisplayOnlycolumns). The UI opens a selection dialog (search on the text columns and on the descriptions) from the fields of the Object Page and the filters of the List Report.- Standard views: a source of the project that names one of these views without defining it receives it, with its text view (
_Text, category#TEXT) and its tables (rapt_currency,rapt_currencyt,rapt_uom,rapt_uomt,rapt_country,rapt_countryt,rapt_language,rapt_languaget). The elements have the SAP names; the tables are specific to Open RAP Runtime (ABAP Cloud code does not read the SAP tables). A view defined by the project wins. The files are virtual (<standard>/…):rapt abapgitnever writes them. - Reference data: ISO 4217 currencies (with their decimals), ISO 3166 countries (three-letter code, currency, EU membership), common units (SAP code, ISO code, dimension), languages (one-character SAP key, ISO code); texts in English.
db/schema.sqlinserts them (ON CONFLICT DO NOTHING): a row added or changed by the application stays. The standard tables do not count for "all the tables are empty" of the initial data (D42). - Value helps: as in RAP, the entity of a value help and its text view are exposed implicitly by the service, read-only, without a page in the UI.
$metadatacarriesCommon.ValueList(CollectionPath,InOutparameter,DisplayOnlycolumns). The UI opens a selection dialog (search on the text columns and on the descriptions) from the fields of the Object Page and the filters of the List Report.
- Standard views: a source of the project that names one of these views without defining it receives it, with its text view (
- Answer to the question "must the currencies be maintained as on BTP?": on BTP, the content of these views is delivered by SAP and is not to be entered; here it is delivered with Open RAP Runtime the same way. The other released views useful next:
I_Region,I_CalendarDate(calendar),I_Timezone,I_BusinessUserBasic(users, to link to the IdP),I_ExchangeRate(exchange rates, to link to a source of rates). - Views added afterwards:
I_RegionandI_RegionText(regions of the United States, Canada, Germany and Australia),I_CalendarDate(calendar from 1990 to 2060 computed bygenerate_series: year, quarter, month, ISO week, day of the week),I_TimeZoneandI_TimeZoneText(common IANA time zones),I_BusinessUserBasic(a user of the IdP is recorded in it on each authenticated request: identifier, name, e-mail) andI_ExchangeRate(empty tablerapt_exchrate: the rates are data of the application). A service definition that exposes a standard view receives it too. - Tests:
compiler/test/standard.test.ts,runtime/test/standard-views.test.ts(read, texts, read-only, value help in the browser, calendar, users).
D45 — standard and enhanced modes
- Decision:
rapt/config.json({ "mode": "enhanced" }) or--modechooses the mode of the project.standard(default): the sources behave as on SAP and what SAP refuses is refused; a project that builds in this mode imports and activates on SAP.enhanced: the extensions of Open RAP Runtime, which do not exist on SAP: information inenhanced; with an initial mandatory field fails, with one message per field (%element). Instandard, as in RAP (D20), onlymandatory : createis checked.- managed BO with unmanaged save on a custom entity (D43): error BDEF027 in
standard, information inenhanced; field ( mandatory )checked on save without a validation: each created or changed instance with an initial mandatory field fails, with one message per field (%element). Instandard, as in RAP (D20), onlymandatory : createis checked.
- managed BO with unmanaged save on a custom entity (D43): error BDEF027 in
- Why a file: the mode is a property of the project, versioned with its sources; the CLI,
rapt devand the VS Code extension (command Choose the project mode) read it. - Tests:
compiler/test/config.test.ts,runtime/test/custom-entity.test.ts.
D46 — rapt generate: one object at a time, derived from the existing objects
- Decision:
rapt generate <src> <type> <name> [--from X] [--for Y] [--expose A,B] [--root]writes an object with the file names of abapGit, then its XML: table, view (from a table, elements in CamelCase, administrative annotations), projection (associations redirected by the same renaming:ZC_Travel ← ZR_TravelgivesZC_Booking), metadata extension, access control, BDEF (managed with its compositions: locks, authorizations and ETag of the children, UUID numbering, read-only administrative fields, mapping; or projection BDEF), behavior pool (one handler per entity, global authorization), abstract entity, custom entity and its query class, class, interface, service definition and binding. An existing file is never overwritten. - Why: the creation wizards of ADT derive an object from the previous one;
rapt newwrites a whole BO,rapt generateaccompanies the construction step by step. - VS Code: New RAP object… (type, source object picked in a list, proposed name).
- Tests:
compiler/test/generate.test.ts(a complete BO built command by command, without a diagnostic),vscode/test/rapt.test.ts.
D47 — MCP server of the service
- Decision:
rapt mcp <src>writesrapt/mcp.json, one tool per operation of the service (<Set>_list,_get,_create,_update,_delete,_create<_Composition>,_<action>), each with a description to complete to explain to an agent what the tool does and when to use it;falseremoves a tool. Running the command again keeps the written descriptions, adds the new tools and removes those the service no longer has. The application built with this file serves the tools on/mcp(Model Context Protocol, "Streamable HTTP" transport, JSON responses, without an SSE stream). - Execution: each call is an OData request run by the service, for the user of the MCP request: authorizations, DCL, feature control, validations and messages are those of the OData. The errors of the BO come back as text (
isError), the result asstructuredContent. - Authentication: bearer token (OIDC) or development user; never the session cookie of the browser (a web page could otherwise call the tools on behalf of the user).
- Tests:
compiler/test/mcp.test.ts,runtime/test/mcp.test.ts(protocol, read, write with messages, actions, create by composition).
D48 — Spaces and pages of the launchpad
- Decision:
launchpad.jsonacceptsspaces(title, roles) →pages→sectionsof tiles, like the SAP Fiori launchpad in spaces mode. A user sees the spaces of their roles as tabs, the pages of a space in a list; the last space is remembered (local storage of the browser); the search covers all the spaces. A file withgroupsonly gives a space of one page.groupsof the model stays the list of all the sections (intents, search). - Tests:
compiler/test/launchpad.test.ts,runtime/test/launchpad-ui.test.ts.
D49 — Development launchpad and documentation application
- Decision:
rapt devserves at/a development launchpad: the application (with the number of instances of its list), the documentation of Open RAP Runtime, the$metadataand, withrapt/mcp.json, the MCP server. The application and the documentation show the shell bar there. The documentation is an OpenUI5 application (list of the pages, search, links between pages) whose pages are rendered from the Markdown of the repository at build time (our own renderer, without a dependency); it is copied next to the compiler (packages/compiler/docs) so that the packaged rapt (npm, VS Code extension) has it too. None of this is inrapt build: it is a development tool. - Tests:
compiler/test/docs.test.ts,compiler/test/dev.test.ts.
D50 — Deployment outside localhost
- Decision: the generated application and launchpad deploy as is anywhere Node.js 22 or a container runs. In addition to the Dockerfile, they have a Cloud Foundry
manifest.yml(SAP BTP) and a.cfignore. The runtime reads the environment of Cloud Foundry:PUBLIC_URLfrom the route (VCAP_APPLICATION),DATABASE_URLandDATABASE_CAfrom a bound PostgreSQL service (VCAP_SERVICES); a variable given explicitly wins.DATABASE_CAgives the certificate of the PostgreSQL server (verified TLS connection).rapt dev --host 0.0.0.0opens the development server to the network. Guide: DEPLOYMENT.md. - Tests:
runtime/test/platform.test.ts,compiler/test/app-scaffold.test.ts.
D51 — UI: filter bar, user variants, refresh
- Filter bar: the Go, Clear and Adapt Filters buttons are aligned with the fields. Each filter accepts conditions as in SAP Fiori (
=x,!=x,>x,>=x,<x,<=x,a...b,*x*,x*,*x; a single value: "contains" for a text, "equal" otherwise), several per field (tokens: included values combined with OR, exclusions with AND); a string of digits (NUMC) is entered without its leading zeros; dates as ranges, date-times by whole days (UTC). Adapt Filters adds the columns of the list as filters. The "Filtered By" summary shows when the header is collapsed. - Variants:
sap.m.VariantManagement(OpenUI5): filters, visible filters, visible columns and sorting (table settings) saved per user by the service ($variants?page=…, tablerapt_ui_variantcreated on first use), default variant, favorites, renaming and deletion; in the local storage of the browser when the service does not keep them. - Refresh: the list reloads when you come back to it after a change saved on an Object Page (deletion, save, action); the title of the table gives the number of rows.
- Object Page: breadcrumbs to the list; unsaved changes are discarded (with a confirmation) when leaving the page, and are no longer sent with the next save.
- Tests:
compiler/test/ui.test.ts(conditions),runtime/test/ui.test.ts(in the browser).
D52 — $apply: aggregation in the OData runtime
- Context: the Analytical List Page and the Overview Page (D53) need totals and groups; Fiori Elements requests them with
$apply(OData Data Aggregation). - Decision: the runtime reads
$applywithfilter(…), then agroupby((P,…)),groupby((P,…),aggregate(…))oraggregate(…)transformation; methodssum,min,max,average,countdistinctand$count as Alias. The SQL query is aGROUP BYon the view of the entity, with the access controls (DCL) of the user;$orderbyon the dimensions and the aliases,$top,$skip,$count. The other transformations (topcount,compute, a transformation after the grouping…) answer 501. - Why: it is the part of OData Data Aggregation the floorplans use; the rest requires the
@Aggregationannotation transactional BOs do not have. - Tests:
runtime/test/odata-apply.test.ts.
D53 — Floorplans: Worklist, Analytical List Page, Overview Page, Form entry
- Context: Fiori Elements chooses the floorplan in the descriptor of the application; the RAP sources say nothing about it. The floorplan is therefore a setting of the project.
- Decision:
uiofrapt/config.json:{ "floorplans": { "<EntitySet>": "listReport" | "worklist" | "analyticalListPage" | "formEntry" }, "overview": { "title": "…", "cards": [ … ] } }. entity, with the number of instances of each tab;#BAR,#LINE,#PIE,#DONUT) above the table, read with$apply(D52); a value chosen in the chart filters the table; chart view, table view or both;table: filtered and sorted instances;chart: a@UI.chart), each card opens the list or the instance. The chart is our own OpenUI5 control in SVG (sap.vizonly exists in SAPUI5).- Worklist: list without a filter bar, one tab per qualified
@UI.selectionVariantof the entity, with the number of instances of each tab; - Analytical List Page: the first
@UI.chartof the entity (dimension, measures,#COLUMN,#BAR,#LINE,#PIE,#DONUT) above the table, read with$apply(D52); a value chosen in the chart filters the table; chart view, table view or both; - Form entry: the Object Page for creation only; after the save, a new empty form;
- Overview Page: home page of cards (
kpi: aggregate of a measure or count;list,table: filtered and sorted instances;chart: a@UI.chart), each card opens the list or the instance. The chart is our own OpenUI5 control in SVG (sap.vizonly exists in SAPUI5).
- Worklist: list without a filter bar, one tab per qualified
- Why: the same annotations as Fiori Elements (
UI.chart,UI.selectionVariant), without a proprietary library; a checked setting (CFG003) rather than a descriptor to write. - Tests:
compiler/test/config.test.ts,compiler/test/ui.test.ts,runtime/test/ui-floorplans.test.ts(browser).
D54 — Draft (with draft)
- Context: draft is the standard way to edit in Fiori Elements V4; a managed RAP BO declares it with
with draft;and onedraft tableper entity. - Decision: optimized
,Discard,Resume,draft determine action Prepare; an entity without adraft table: BDEF028.HasActiveEntity, dates of the draft) andrapt_draft_admin(user, creation, last change); a<projection>_allview combines active instances and drafts.DraftAdministrativeData, actionsEdit,Activate,Prepare,Resume,Discard,Common.DraftRoot/DraftNode. A user only reads their own drafts. validations;Editcopies the instance and its compositions (one draft per instance, exclusive lock of 15 minutes as SAP);Activate` replays the draft in the managed runtime in the LUW of the request (determinations, validations, saver), keys kept, then deletes the draft; an active instance that has a draft cannot be changed directly (409). Cancel and Discard Draft discard; the list shows the editing status.- BDEF:
with draft,draft table,total etag,draft action Edit,Activate optimized,Discard,Resume,draft determine action Prepare; an entity without adraft table: BDEF028. - Database: one draft table per entity (the elements of the entity,
DraftUUID,HasActiveEntity, dates of the draft) andrapt_draft_admin(user, creation, last change); a<projection>_allview combines active instances and drafts. - OData:
IsActiveEntitykey, propertiesHasActiveEntity,HasDraftEntity, navigationDraftAdministrativeData, actionsEdit,Activate,Prepare,Resume,Discard,Common.DraftRoot/DraftNode. A user only reads their own drafts. - Runtime: creation, change and deletion in the draft without determinations nor validations;
Editcopies the instance and its compositions (one draft per instance, exclusive lock of 15 minutes as SAP);Activatereplays the draft in the managed runtime in the LUW of the request (determinations, validations, saver), keys kept, then deletes the draft; an active instance that has a draft cannot be changed directly (409). - UI: Create opens a draft, each field is saved in it when leaving it, Save activates, Cancel and Discard Draft discard; the list shows the editing status.
- BDEF:
- Why: the observable behavior of SAP (URLs, keys, actions, lock) so that the sources and the clients stay those of an SAP system.
- Tests:
runtime/test/draft.test.ts,runtime/test/ui-draft.test.ts(browser),compiler/test/ir.test.ts(BDEF028).
D55 — Table entities, CDS simple types and enumerated types
- Context: recent ABAP Cloud adds CDS table entities (
define table entity: a table and its entity in one object, persistence of a RAP BO) and CDS types (define type, DRTY objects): simple types and enumerated types (enum). SAP does not expose enumerated types in RAP OData services ("Development Constraints" of RAP). - Decision: parsing it): a simple type is worth its base type (built-in type, data element or another CDS type), with its label; an enumerated type has a base type (
abap.int1,int2,int4,char(1..8),numc(1..8)), exactly oneinitialconstant, unique constants and values (TYPE001 to TYPE003). A type typed by an enumerated type takes its constants. They type the elements of the table entities, of the abstract and custom entities.null; keys first;abap.stringdeclarednull, CDS019-CDS020) and a view entity on this table. A managed BDEF on the table entity does not writepersistent table: the table entity is its persistence. Views and projections read it as an entity; the ABAP SQL of the behavior pool reads and writes its table. the type is given to the transpiler as a data element of its base type and eachtype-constantconstant becomes the literal of its value (same line, same meaning). (CDS021), as on SAP. Inenhancedmode, it becomes anEnumTypeof the$metadata: members named like the constants, integer value (the base value when it is an integer, the position otherwise), label asCore.Description. The JSON carries the name of the member ("Status": "OPEN");$filteracceptsStatus eq 'OPEN',Ns.Type'OPEN'and the integer value; a value outside the type is refused (400). The UI shows the labels and offers a choice list (OpenUI5 cannot write enumeration literals: the filter goes through$filter). object in the AFF format of abapGit (SAP/abap-file-formats repository): the source<name>.drty.acdsand its metadata<name>.drty.json(formatVersion, description, language), written byrapt abapgit(.drty.asdrtyis still read).- CDS types (
<name>.drty.acds, read by Open RAP Runtime: abaplint knows the object without parsing it): a simple type is worth its base type (built-in type, data element or another CDS type), with its label; an enumerated type has a base type (abap.int1,int2,int4,char(1..8),numc(1..8)), exactly oneinitialconstant, unique constants and values (TYPE001 to TYPE003). A type typed by an enumerated type takes its constants. They type the elements of the table entities, of the abstract and custom entities. - Table entity: a table with the same name (elements in lower case;
NOT NULLunlessnull; keys first;abap.stringdeclarednull, CDS019-CDS020) and a view entity on this table. A managed BDEF on the table entity does not writepersistent table: the table entity is its persistence. Views and projections read it as an entity; the ABAP SQL of the behavior pool reads and writes its table. - Enumerated values: stored in the database with their base value. In the behavior pool, the type is given to the transpiler as a data element of its base type and each
type-constantconstant becomes the literal of its value (same line, same meaning). - OData: in
standardmode, an enumerated element in an exposed entity is an error (CDS021), as on SAP. Inenhancedmode, it becomes anEnumTypeof the$metadata: members named like the constants, integer value (the base value when it is an integer, the position otherwise), label asCore.Description. The JSON carries the name of the member ("Status": "OPEN");$filteracceptsStatus eq 'OPEN',Ns.Type'OPEN'and the integer value; a value outside the type is refused (400). The UI shows the labels and offers a choice list (OpenUI5 cannot write enumeration literals: the filter goes through$filter). rapt generate tableentity|type|enum, DDLS of typeTforrapt abapgit. A CDS type is an object in the AFF format of abapGit (SAP/abap-file-formats repository): the source<name>.drty.acdsand its metadata<name>.drty.json(formatVersion, description, language), written byrapt abapgit(.drty.asdrtyis still read).
- CDS types (
- Why: the table entity is a complete BO in two files; enumerated types give named values to the API without changing the storage. The
standardmode stays activatable on SAP, the exposure as an enumeration is an extension (D45). - Tests:
compiler/test/table-entity.test.ts,runtime/test/table-entity.test.ts(OData, ABAP, browser), fixturefixtures/table-entity.
D56 — Value helps: bindings, validation, fixed values, action parameters
- Context: D44 gave the simple value help (
entity: { name, element }); RAP BOs also useadditionalBinding,useForValidationand drop-down lists. - Decision: local value (
Common.ValueListParameterIn),#RESULTcopies the element of the chosen row into the local element (ValueListParameterOut), without a usage both (InOut); missing from the list (error state of the field);Common.ValueListWithFixedValues, and a drop-down list (value and description) in the UI; exposed by the service (as in RAP, which does not add it implicitly).additionalBinding: [{ localElement, element, usage }]:#FILTERrestricts the list by the local value (Common.ValueListParameterIn),#RESULTcopies the element of the chosen row into the local element (ValueListParameterOut), without a usage both (InOut);useForValidation: true:Common.ValueListForValidation; the UI reports an entered value missing from the list (error state of the field);@ObjectModel.resultSet.sizeCategory: #XSon the entity of the value help:Common.ValueListWithFixedValues, and a drop-down list (value and description) in the UI;- the action parameters (abstract entity) have their value help in the dialog, if its entity is exposed by the service (as in RAP, which does not add it implicitly).
- Why: they are the value help forms of common RAP BOs, and Fiori Elements interprets them from the
$metadata. - Tests:
compiler/test/table-entity.test.ts(CSDL),runtime/test/table-entity.test.ts(drop-down list that fills the currency, validation, in the browser),runtime/test/standard-views.test.ts.
D57 — Display annotations: criticality, texts, header, links, filters
- Context: the generated UI followed the structure annotations (
lineItem,identification,facet…) but not the common display annotations of RAP BOs; the complete table is in ANNOTATIONS.md. - Decision:
ObjectNumber(1 negative, 2 critical, 3 positive); Elements), "ID (Text)", text only, separate;@UI.facetpurpose#HEADER(#DATAPOINT_REFERENCE,#FIELDGROUP_REFERENCE): header of the Object Page, progress bar (#PROGRESS,targetValue), rating (#RATING), number;mailto:/tel:links (Communicationvocabulary);#WITH_URLline item: link;mandatory(mandatory filter,FilterRestrictions),selectionType/multipleSelections(one value); annotation replaced the first one).criticality(line item, identification, data point): coloredObjectStatusorObjectNumber(1 negative, 2 critical, 3 positive);@ObjectModel.text.element+@UI.textArrangement: "Text (ID)" (default, as in Fiori Elements), "ID (Text)", text only, separate;@UI.dataPoint(UI.DataPoint, qualified by itsqualifieror the name of the element) and@UI.facetpurpose#HEADER(#DATAPOINT_REFERENCE,#FIELDGROUP_REFERENCE): header of the Object Page, progress bar (#PROGRESS,targetValue), rating (#RATING), number;@UI.multiLineText: text area;@Semantics.email.address,@Semantics.telephone.type:mailto:/tel:links (Communicationvocabulary);#WITH_URLline item: link;@Consumption.filter.defaultValue(initial filter, applied by the standard variant),mandatory(mandatory filter,FilterRestrictions),selectionType/multipleSelections(one value);@Consumption.hidden: element not exposed, except a key or the element of an association.- Fix:
@UI.facet: […]then@UI: { … }on the same element keep both (the second annotation replaced the first one).
- Why: they are the annotations the SAP examples (RAP100, Flight) use on each BO; they change what the user sees without changing the BO.
- Tests:
compiler/test/table-entity.test.ts(CSDL),runtime/test/table-entity.test.ts(browser), fixturefixtures/table-entity.
D58 — Draft UI as in Fiori Elements
- Context: the first draft UI (D54) edited and activated, but without the landmarks of Fiori Elements: the list showed the active instance even when the user had a draft, without an editing status filter nor a saving indicator.
- Decision: No Changes); All shows the drafts of the user instead of their active instances (
IsActiveEntity eq false or HasDraftEntity eq false or DraftAdministrativeData/InProcessByUser ne '<user>', likeSiblingEntityat SAP); Draft and Locked by X markers (ObjectMarker). The active instance points to the administrative data of its draft (DraftUUID), as at SAP. editing,DraftIndicatorin the footer ("Saving draft…", "Draft updated"); Discard Draft asks "Discard all changes?"; leaving the page in draft offers Keep Draft / Discard Draft (the draft stays in the list).- List Report: Editing Status filter (All, Own Draft, Locked by Another User, No Changes); All shows the drafts of the user instead of their active instances (
IsActiveEntity eq false or HasDraftEntity eq false or DraftAdministrativeData/InProcessByUser ne '<user>', likeSiblingEntityat SAP); Draft and Locked by X markers (ObjectMarker). The active instance points to the administrative data of its draft (DraftUUID), as at SAP. - Object Page: Draft marker in the header, Locked by X on an instance another user is editing,
DraftIndicatorin the footer ("Saving draft…", "Draft updated"); Discard Draft asks "Discard all changes?"; leaving the page in draft offers Keep Draft / Discard Draft (the draft stays in the list). - The current user is given to the UI by
$permissions($user).
- List Report: Editing Status filter (All, Own Draft, Locked by Another User, No Changes); All shows the drafts of the user instead of their active instances (
- Why: a Fiori Elements user finds the same gestures; no SAP library (OpenUI5 controls
ObjectMarker,DraftIndicator). - Tests:
runtime/test/ui-draft.test.ts(browser).
D59 — Collaborative draft
- Context:
with collaborative draft;anddraft action Share;(ABAP Cloud) let several users edit the same draft; the users invited withShareor who join the draft change it, activate it or discard it. - Decision:
use action Share;in the projection. ShareAll),Common.DraftRoot/ShareAction, entityDraftAdministrativeUser(navigationDraftAdministrativeData/DraftAdministrativeUser`). the user join the draft (instead of 409); every user of the draft reads it, changes it, activates it, discards it; the others receive 409 / 404 as for an exclusive draft. every 5 seconds to show the changes of the others.- BDEF:
with collaborative draft;in the header,draft action Share;mandatory (BDEF029),use action Share;in the projection. - Database:
rapt_draft_user(draft, user, roleOowner /Eeditor). - OData: action
Share(Users: Collection(DraftAdministrativeUserInput{UserID, UserAccessRole}), ShareAll),Common.DraftRoot/ShareAction, entityDraftAdministrativeUser(navigationDraftAdministrativeData/DraftAdministrativeUser). - Runtime: the creator is the owner;
Editof an instance whose draft another user has makes the user join the draft (instead of 409); every user of the draft reads it, changes it, activates it, discards it; the others receive 409 / 404 as for an exclusive draft. - UI: in draft, the users (avatars) and Invite (
Share); the page reads the draft again every 5 seconds to show the changes of the others.
- BDEF:
- Why: the behavior of SAP (actions, entities, annotation) so that Fiori Elements and the OData clients find their way; the periodic refresh replaces the WebSockets (ABAP Channels) of SAP.
- Tests:
runtime/test/draft-collaborative.test.ts(OData, browser, BDEF029).
D60 — Web APIs: OData V4 - Web API binding, OAuth 2.0 (client credentials, PKCE)
- Context: a RAP service is also exposed as an API for other systems (OData V4 - Web API binding). The callers authenticate with OAuth 2.0: client credentials (machine to machine) or authorization code with PKCE (application on behalf of a user).
- Decision:
rapt generate binding … --binding-type webapi. As at SAP: noUI.*annotation, nor value help, nor side effects, nor feature control (__EntityControl…) in the service (the checks are still applied by the runtime); no generated UI; a draft BO only exposes its active instances (direct writes, withoutIsActiveEntity). Cloud Identity Services, Entra ID…) obtained with either flow; a client credentials token withoutpreferred_usernamedesignates its client (client_id) as a technical user; its roles can come fromscope(OIDC_ROLES_CLAIM=scope). The browser sessions already used the PKCE flow.DEV_OAUTH=on) serves a development authorization server under/oauth: OIDC discovery, JWKS,/oauth/token(client_credentialswithrapt-client/rapt-secret,authorization_codewith S256 PKCE verification),/oauth/authorize(page to choose the user and their roles); configurable clients (DEV_OAUTH_CLIENTS). Its tokens (RS256, key generated on start) give a development user.- Binding:
BINDING_TYPE_CATEGORY1 of the SRVB, or--binding-type webapi, orrapt generate binding … --binding-type webapi. As at SAP: noUI.*annotation, nor value help, nor side effects, nor feature control (__EntityControl…) in the service (the checks are still applied by the runtime); no generated UI; a draft BO only exposes its active instances (direct writes, withoutIsActiveEntity). - Production (
AUTH_MODE=oidc): the service accepts the tokens of the IdP (Keycloak, SAP Cloud Identity Services, Entra ID…) obtained with either flow; a client credentials token withoutpreferred_usernamedesignates its client (client_id) as a technical user; its roles can come fromscope(OIDC_ROLES_CLAIM=scope). The browser sessions already used the PKCE flow. - Development:
rapt dev(and an application started withAUTH_MODE=noneandDEV_OAUTH=on) serves a development authorization server under/oauth: OIDC discovery, JWKS,/oauth/token(client_credentialswithrapt-client/rapt-secret,authorization_codewith S256 PKCE verification),/oauth/authorize(page to choose the user and their roles); configurable clients (DEV_OAUTH_CLIENTS). Its tokens (RS256, key generated on start) give a development user.
- Binding:
- Why: test an API exactly as its clients will call it (Postman, Bruno, another system) without installing an IdP; in production, the IdP stays the only source of tokens.
- Tests:
runtime/test/web-api.test.ts(binding, client credentials, PKCE),runtime/test/auth.test.ts(client token).
D61 — Guided creation of the objects, floorplan, CLI / extension parity
- Context: ADT guides the creation of an object (New ABAP Repository Object: types by category, description, reference object); the extension only offered a series of quick picks, and the floorplan of the UI could only be chosen by editing
rapt/config.json. - Decision: description, files, length of the name, fields: source object, exposed entities, binding type, built-in type);
rapt generate <src> --jsonwithout a type returns it. The extension builds its wizard from it: the CLI stays the only source. objects of the project offered as source), Create runsrapt generate(orrapt newfor a complete BO) and opens the file. New types: data element and domain (--type).ui.floorplansofrapt/config.json; the VS Code command describes each floorplan (use, required annotations).launchpad,dev,new,abapgit,mcp,generate,floorplan).- Catalog:
authoring/catalog.tsdescribes each object type (category, label, description, files, length of the name, fields: source object, exposed entities, binding type, built-in type);rapt generate <src> --jsonwithout a type returns it. The extension builds its wizard from it: the CLI stays the only source. - Wizard (New RAP object webview): filter, types by category, form of the type (the objects of the project offered as source), Create runs
rapt generate(orrapt newfor a complete BO) and opens the file. New types: data element and domain (--type). - ***RAP Objects* view**: the objects of the project grouped like the project explorer of ADT.
- Floorplan:
rapt floorplan <src> [<EntitySet> <floorplan>]reads and writesui.floorplansofrapt/config.json; the VS Code command describes each floorplan (use, required annotations). - Parity: each command of the CLI has its VS Code command (
check,ir,build,launchpad,dev,new,abapgit,mcp,generate,floorplan).
- Catalog:
- Why: an ABAP developer finds the gestures of ADT; the choice of the floorplan becomes explicit and documented at the moment it is made.
- Tests:
vscode/test/rapt.test.ts(catalog, arguments of the wizard,rapt floorplan, groups), wizard checked in Chromium.
D62 — Website of the project and download of the extension
- Decision:
site/(static HTML and CSS, without a dependency nor a build tool) presents the project; thesite.ymlworkflow publishes it on GitHub Pages with the screenshots ofdocs/imagesand the.vsixbuilt from the same commit (Download button). The tagged versions are still published byrelease.yml(GitHub Release, Marketplace and Open VSX when their tokens are configured). To enable once: Settings → Pages → Source: GitHub Actions. - Why: one address to share, always up to date, without a server to maintain.
- Tests: rendering checked in Chromium (desktop, mobile without horizontal scrolling, dark mode).
D63 — English everywhere; documentation pages on the website
- Context: the project was documented in French, and the website linked to pages of the GitHub repository, which is private: visitors could not read the guide.
- Decision: and floorplan catalog, messages and comments are in English (AGENTS.md rule 8). The documents with French names were renamed (
DEPLOYMENT.md,UTILITIES.md,REMOTE_APIS.md). the documentation app (same list and order asrapt dev, D49) into a static pagedocs/<name>.htmlof the website, with the Markdown renderer of the compiler, a navigation between the pages and the style of the website. Links between documents point to the rendered pages; links to files of the repository that are not published (sources, fixtures) are shown as plain text. Thesite.ymlworkflow runs the script afterpnpm build. The website no longer links to GitHub.- English: documentation, website, VS Code extension (commands, wizard, settings), object and floorplan catalog, messages and comments are in English (AGENTS.md rule 8). The documents with French names were renamed (
DEPLOYMENT.md,UTILITIES.md,REMOTE_APIS.md). - Documentation on the website:
scripts/build-site.mjsrenders each Markdown document of the documentation app (same list and order asrapt dev, D49) into a static pagedocs/<name>.htmlof the website, with the Markdown renderer of the compiler, a navigation between the pages and the style of the website. Links between documents point to the rendered pages; links to files of the repository that are not published (sources, fixtures) are shown as plain text. Thesite.ymlworkflow runs the script afterpnpm build. The website no longer links to GitHub.
- English: documentation, website, VS Code extension (commands, wizard, settings), object and floorplan catalog, messages and comments are in English (AGENTS.md rule 8). The documents with French names were renamed (
- Why: a private repository cannot be the documentation of a public website; rendering from the same Markdown keeps a single source, already shown in
rapt dev. - Tests:
compiler/test/docs.test.ts(rendering of the links for the website), website checked in Chromium (pages, navigation, mobile, dark mode).
D64 — rapt for AI coding agents: rapt agent, rapt in the terminals of VS Code
- Context: AI agents (GitHub Copilot in agent mode, Claude Code, Cursor…) write more and more of the RAP sources. With a shell, they can run
rapt check --json; but in VS Coderaptwas only inside the extension (not on the PATH), and the documentation of Open RAP Runtime (codes, annotations, known gaps and their workarounds) is not in the project of the user, so an agent could not find it. Also, the.vsixlost this documentation: the staging of the extension removed thedocsfolders and the.mdfiles of the packages, and the documentation app ofrapt devwas empty when started from the extension. - Decision: tools
rapt_projects,rapt_check(diagnostics, without writing),rapt_object_types(the catalog of D61),rapt_generate,rapt_new_business_object,rapt_floorplan,rapt_abapgit,rapt_docs_search(sections of the documentation by relevance) andrapt_docs_read(a page or a section, as Markdown), and instructions given oninitialize(check after each change, standard mode, read the documentation). The paths are relative to the workspace; a path outside it is refused. The project is given, or the only one of the workspace. Distinct fromrapt mcp(D47), the MCP server of a service. (vscode.lm.registerMcpServerDefinitionProvider, contributionmcpServerDefinitionProviders, one server per workspace folder, settingrapt.agent.enabled); and it putsrapton the PATH of its integrated terminals (environmentVariableCollection): shimsrapt(sh) andrapt.cmd(Windows) in the storage of the extension start the CLI the extension uses, with the Node.js of VS Code (settingrapt.terminal.addToPath). An agent of the terminal (Claude Code) then runsraptorclaude mcp add rapt -- rapt agent .without installing anything. when it is missing; the documentation app shows "Documentation not found" instead of an empty list if the documentation is ever missing.rapt agent [<workspace>]: an MCP server over stdio (newline-delimited JSON-RPC) with the toolsrapt_projects,rapt_check(diagnostics, without writing),rapt_object_types(the catalog of D61),rapt_generate,rapt_new_business_object,rapt_floorplan,rapt_abapgit,rapt_docs_search(sections of the documentation by relevance) andrapt_docs_read(a page or a section, as Markdown), and instructions given oninitialize(check after each change, standard mode, read the documentation). The paths are relative to the workspace; a path outside it is refused. The project is given, or the only one of the workspace. Distinct fromrapt mcp(D47), the MCP server of a service.- VS Code: the extension registers
rapt agentfor the agent mode of VS Code (vscode.lm.registerMcpServerDefinitionProvider, contributionmcpServerDefinitionProviders, one server per workspace folder, settingrapt.agent.enabled); and it putsrapton the PATH of its integrated terminals (environmentVariableCollection): shimsrapt(sh) andrapt.cmd(Windows) in the storage of the extension start the CLI the extension uses, with the Node.js of VS Code (settingrapt.terminal.addToPath). An agent of the terminal (Claude Code) then runsraptorclaude mcp add rapt -- rapt agent .without installing anything. - Documentation in the
.vsix: the staging keeps@open-rap/compiler/docsand fails when it is missing; the documentation app shows "Documentation not found" instead of an empty list if the documentation is ever missing.
- Why an MCP server and not only the CLI: the CLI with
--jsonand the AGENTS.md of the project are enough for an agent with a shell; the MCP server adds what the CLI does not give: discovery without configuration in VS Code, typed inputs (the catalog of the objects as enums), and the documentation of Open RAP Runtime, searchable, wherever the extension or the npm package is installed. It reuses the functions of the CLI: one engine (D39). - Tests:
compiler/test/agent.test.ts(protocol, business object created, checked, object generated, floorplan, abapGit, paths outside the workspace, several projects, documentation, stdio of the built CLI),vscode/test/rapt.test.ts(shims runrapt checkthrough the PATH, server definitions),compiler/test/docs.test.ts(empty documentation);.vsixbuilt and itsrapt devchecked to serve the 14 documentation pages.
D65 — npm package open-rap-runtime
- Context: outside VS Code (CI pipelines, a terminal agent, another editor), rapt needed a clone of the repository.
- Decision: the package
open-rap-runtime(packages/cli) gives theraptcommand (npm install -g open-rap-runtime,npx open-rap-runtime check ., or adevDependencyof the project andnpx rapt …). It depends on@open-rap/compilerand@open-rap/runtimeand on whatrapt devserves (OpenUI5, PGlite, less-openui5, at the versions of the runtime, checked by a test), like therapt/of the extension (D39). Itsdist/rapt.jscallsmainof@open-rap/compiler/cli(new export);cli.jsruns itself only when it is the program (isEntryPoint: real paths compared, symbolic links and Windows paths included), so the command runs once. The compiler no longer declares abin: one package givesrapt.COMPILER_VERSIONis read from thepackage.jsonof the compiler. Each package has a README for npm;@open-rap/model,compilerandruntimeare also usable as libraries. - Release: the
npmjob ofrelease.ymlsets the version of the tag on the four packages, builds them, packs them (pnpm pack), installs the archives with npm in an empty folder and runsrapt --help,rapt checkandrapt buildof the fixture; then, when the secretNPM_TOKENis set, publishes them (workspace:*becomes the version of the tag). npm provenance is added when the repository is public. Once: create theopen-rap-runtimeorganization on npmjs.com and theNPM_TOKENsecret (DEPLOYMENT.md). Since D77 and D78: the version is the committed one, and npm trusts the workflow by trusted publishing, withoutNPM_TOKEN. The nameraptis taken on npm, henceopen-rap-runtime. - Why: the same CLI everywhere; CI can check RAP sources without VS Code; a terminal agent can install it in one command.
- Note: publishing makes the compiled code public on npm, as the
.vsixof the website already does. - Tests:
cli/test/package.test.ts(dependencies, a single run),cli/test/cli.test.ts(rapt check,rapt agentin the help),compiler/test/cli.test.ts(isEntryPoint); the four packages packed and installed with npm in an empty folder:rapt check,rapt dev(UI, OpenUI5, OData, documentation) work;pnpm publish --dry-run.
D66 — Menus of the extension: two ways to create, greyed-out commands, required floorplan
- Context: the right click of the explorer showed three creation entries (New business object, New RAP object (wizard)…, New RAP object… (table, view…)), all the commands were active even outside a project, and the application was generated as a List Report without the floorplan having been chosen.
- Decision: folder) builds the whole BO; New RAP object… (the wizard, D61) creates object by object. The quick picks of D46 (
rapt.generate) stay a command, outside the menus and the palette. build); the RAP Objects view offers the same on a project, and a New complete business object button when the workspace has no project. those of the projects that have a service definition (rapt.apps) from the sources of the workspace, updated when a file is created or deleted. The commands have anenablement:resourcePath in rapt.projects(orrapt.apps) in the explorer, a project (or a service) in the workspace elsewhere; Stop and Open the application when rapt dev runs. of each root entity set that has none; cancelling writes nothing and builds nothing.rapt floorplan --jsongiveschosenper entity set, andrapt floorplan . Set listReportwrites the List Report inrapt/config.json(instead of removing it) to keep the choice. The CLI keeps the List Report as the default.- Create: two entries. New complete business object… (
rapt new, possible in an empty folder) builds the whole BO; New RAP object… (the wizard, D61) creates object by object. The quick picks of D46 (rapt.generate) stay a command, outside the menus and the palette. - Groups of the menu: create, project (check, abapGit), application (floorplan, rapt dev, build); the RAP Objects view offers the same on a project, and a New complete business object button when the workspace has no project.
- Greyed out: the extension computes the folders of the projects (
rapt.projects) and those of the projects that have a service definition (rapt.apps) from the sources of the workspace, updated when a file is created or deleted. The commands have anenablement:resourcePath in rapt.projects(orrapt.apps) in the explorer, a project (or a service) in the workspace elsewhere; Stop and Open the application when rapt dev runs. - Required floorplan: Build the application… and Start rapt dev ask for the floorplan of each root entity set that has none; cancelling writes nothing and builds nothing.
rapt floorplan --jsongiveschosenper entity set, andrapt floorplan . Set listReportwrites the List Report inrapt/config.json(instead of removing it) to keep the choice. The CLI keeps the List Report as the default.
- Create: two entries. New complete business object… (
- Why: one way to do each gesture, an impossible command is not offered, and the floorplan is a design choice of the application, not a default one suffers.
- Tests:
vscode/test/rapt.test.ts(folders of the projects and of the applications,chosen, List Report kept).
D67 — Expressions in the elements of the CDS views
- Context: a calculated element of the select list (
CASE,CAST, calculation, function, literal) was refused (CDS002), while RAP views often have some (status text, total amount, duration). - Decision: the adapter turns the expression parsed by abaplint into a tree; the IR resolves and types it (
FieldModel.expressioninstead ofcolumn); the SQL generator translates it to PostgreSQL in the view (CAST(… AS type)around the result, for a stable column type).$projection.Element,+ - * /and parentheses, simple and searchedCASE(= <> < > <= >=,[NOT] LIKE,IS [NOT] NULL,AND,OR,NOT),CAST( x AS abap.xxx )or to a data element, functionsconcat,concat_with_space,substring,upper,lower,length,left,right,ltrim,rtrim,replace,coalesce,div,division,mod,abs,round,ceil,floor,dats_days_between,dats_add_days, and$session.system_date(current_date). A projection takes the calculated elements of its view and accepts expressions itself on the elements of the projected entity. largest; decimals: precision and scale combined, 31 digits at most;/:decfloat34), string forconcat(lengths added), common type of the branches of aCASE. When the type cannot be derived (NULLalone,+on a string), CDS022 asks for aCAST. is an integer division,division( a, b, d )rounds toddecimals;/gives a decimal (no integer division of PostgreSQL). the BDEF, nor in the draft table, nor in the writes. In OData, it isCore.Computedand ignored in the body of the requests (OData convention of computed properties). the source that the entity does not expose isNULLthere. In the behavior pool (EML), the value read is the one of the active view: it reflects the last save, not the current changes of the transaction; a draft instance has the initial value there.$session.system_language(the SQL views do not have the session of the request), association paths (_Assoc.field), associations in an expression,BETWEEN, aggregates, SQL functions not listed, parameters and path filters. Joins andWHEREunchanged.- Supported: literals (string, integer, decimal,
abap.xxx'…'), columns of the source,$projection.Element,+ - * /and parentheses, simple and searchedCASE(= <> < > <= >=,[NOT] LIKE,IS [NOT] NULL,AND,OR,NOT),CAST( x AS abap.xxx )or to a data element, functionsconcat,concat_with_space,substring,upper,lower,length,left,right,ltrim,rtrim,replace,coalesce,div,division,mod,abs,round,ceil,floor,dats_days_between,dats_add_days, and$session.system_date(current_date). A projection takes the calculated elements of its view and accepts expressions itself on the elements of the projected entity. - Typing: the explicit
CASTwins; otherwise, calculation on numbers (integers: the largest; decimals: precision and scale combined, 31 digits at most;/:decfloat34), string forconcat(lengths added), common type of the branches of aCASE. When the type cannot be derived (NULLalone,+on a string), CDS022 asks for aCAST. - ABAP semantics:
CHARstrings lose their trailing blanks inconcatandlength;divis an integer division,division( a, b, d )rounds toddecimals;/gives a decimal (no integer division of PostgreSQL). - Read-only: a calculated element cannot be a key (CDS022); it is neither in the mapping of the BDEF, nor in the draft table, nor in the writes. In OData, it is
Core.Computedand ignored in the body of the requests (OData convention of computed properties). - Drafts: the draft view computes the expression on the values of the draft; a column of the source that the entity does not expose is
NULLthere. In the behavior pool (EML), the value read is the one of the active view: it reflects the last save, not the current changes of the transaction; a draft instance has the initial value there. - Still CDS002 (message naming the construct):
$session.user,$session.client,$session.system_language(the SQL views do not have the session of the request), association paths (_Assoc.field), associations in an expression,BETWEEN, aggregates, SQL functions not listed, parameters and path filters. Joins andWHEREunchanged.
- Supported: literals (string, integer, decimal,
- Why: PostgreSQL computes on read, like the HANA database:
$filterand$orderbyon a calculated element work without code at runtime, and the value stays consistent with the data. - Tests: tree of the adapter, inferred types and diagnostics (CDS002, CDS004, CDS022), schema applied on PGlite and values read in the view and the projection,
$metadata(Core.Computed), OData read,PATCHignored and values computed on a draft then after activation.
D68 — Filter value help: Search and Select and Define Conditions
- Context: the filter fields of the List Report (and of the ALP) accepted typed conditions (D51) and opened, for a field with a value help, a list of values (D44); the dialog of SAP Fiori elements where conditions are composed (operator, values, exclusions) next to the selection in the value help was missing. The dialog of
sap.ui.comp/sap.ui.mdcis SAPUI5 only. - Decision: lists) opens a dialog built with
sap.m(controller/conditions.js): a Search and Select tab (when the field has a value help: search, table with multiple or single selection, descriptions of the text view), a Define Conditions tab (one row per condition: operator, value(s), value help on the value, Add), and at the bottom the Selected Items and Conditions tokens; between, less than, less than or equal to, greater than, greater than or equal to, empty, and their exclusions (not equal to, does not contain, not between, not empty…), filtered by type: text all of them, numbers and NUMC comparisons, dates and times comparisons and empty (date / time picker), UUID equal / not equal;and; empty of a text =''ornull; date-time by whole days (UTC);!(=x),*x*,a...b,<empty>,!(…); the key of the token is the condition (=x,!(*x*)) read again for the search and kept in the variants (earlier variants are still read, including the date ranges{ from, to }); contains for a free text, equal to for a key or a field with a value help; dates are entered in the format of the language or in ISO;#SINGLEequal only,#INTERVALcomparisons and ranges (without patterns), a single condition whenmultipleSelections: false(without exclusions forSingleRange).- the icon of each token filter field (all but booleans and enumerated types, which stay choice lists) opens a dialog built with
sap.m(controller/conditions.js): a Search and Select tab (when the field has a value help: search, table with multiple or single selection, descriptions of the text view), a Define Conditions tab (one row per condition: operator, value(s), value help on the value, Add), and at the bottom the Selected Items and Conditions tokens; - operators as in Fiori elements: equal to, contains, starts with, ends with, between, less than, less than or equal to, greater than, greater than or equal to, empty, and their exclusions (not equal to, does not contain, not between, not empty…), filtered by type: text all of them, numbers and NUMC comparisons, dates and times comparisons and empty (date / time picker), UUID equal / not equal;
$filter: included conditions of a field withor, exclusions withand not, fields withand; empty of a text =''ornull; date-time by whole days (UTC);- tokens written as in Fiori elements: value alone (with its description: "Euro (EUR)"),
!(=x),*x*,a...b,<empty>,!(…); the key of the token is the condition (=x,!(*x*)) read again for the search and kept in the variants (earlier variants are still read, including the date ranges{ from, to }); - direct input:
!(…),<empty>anda - b(dates) in addition to D51; a single value is contains for a free text, equal to for a key or a field with a value help; dates are entered in the format of the language or in ISO; @Consumption.filter.selectionType(AllowedExpressionsalready in the CSDL, D57):#SINGLEequal only,#INTERVALcomparisons and ranges (without patterns), a single condition whenmultipleSelections: false(without exclusions forSingleRange).
- the icon of each token filter field (all but booleans and enumerated types, which stay choice lists) opens a dialog built with
- Why: it is the "match code" of the Fiori elements filters; keeping the selection in the value help and the conditions in the same dialog avoids two different gestures for one field.
- Limits: no relative date operators (today, last week…); booleans and enumerated types keep their choice list; a value entered without a value help is shown without a description.
- Tests:
compiler/test/ui.test.ts(reading and writing of the conditions, operators by type andselectionType,$filter),runtime/test/table-entity.test.ts(dialog in Chromium: selection in the value help, exclusion, typed conditions, filtered rows).
D69 — One launchpad per workspace, applications added when they are created
- Context:
launchpad.jsonwas written by hand (D37) and only referenced applications already built (build). In a workspace of several applications (rap-apps/helpdesk-tickets,rap-apps/project-tracker…), you had to write it, build each application then the launchpad, and nothing said that only one was needed. - Decision: the folder of the project then its parents (4 levels, stopping after a folder that contains
.git, never in the root of the disk, the home folder or the temporary folder); without it, it creates it in the parent folder of the project (the workspace), or in the project when it is the root of a git repository or when its parent is one of these system folders.--launchpad <file>designates another file. The extension always passes--launchpad: next to the saved.code-workspace, otherwise in the first folder of the workspace — a single launchpad, even for a multi-root workspace. (choosing the floorplan creates the Fiori application) add the application;--no-launchpadrefrains from it;rapt launchpad add <src>adds it on demand (--json). Theappsentry references the sources ("source": "helpdesk-tickets", relative to the launchpad.json), itsidcomes from the name of the folder, itsurl(local start) takes the first free port from 8081. The tile goes into the "Applications" group (or the "Applications" section of the first page of the first space): title of the application, intent<EntitySet>-manage(processfor a Worklist,analyzefor an Analytical List Page,createfor a Form Entry), icon and counter of the starting entity set. Idempotent: an application already present (same sources, or same id without sources) is not changed, nothing the user wrote is rewritten; an unreadable file is not overwritten. referenced bysourceinout/launchpad/apps/<id>;docker-compose.ymlbuilds them from this folder (one PostgreSQL each) and the image of the launchpad ignores it.sourceandbuildtogether are refused (LPD009);buildstays possible for an application built separately. one application alone (rapt build), which does not depend on the launchpad: its shell bar only shows if/launchpad/configanswers. The extension asks for the mode in Build the application… ("Launchpad (all the applications)" / "Application alone (standalone)"); Build the launchpad… builds the one of the workspace (rapt.hasLaunchpad).rapt devkeeps its development launchpad (D49).- One launchpad per workspace, titled "Launchpad". The CLI looks for
launchpad.jsonin the folder of the project then its parents (4 levels, stopping after a folder that contains.git, never in the root of the disk, the home folder or the temporary folder); without it, it creates it in the parent folder of the project (the workspace), or in the project when it is the root of a git repository or when its parent is one of these system folders.--launchpad <file>designates another file. The extension always passes--launchpad: next to the saved.code-workspace, otherwise in the first folder of the workspace — a single launchpad, even for a multi-root workspace. - Added on creation:
rapt new(complete BO) andrapt floorplan <src> <Set> <floorplan>(choosing the floorplan creates the Fiori application) add the application;--no-launchpadrefrains from it;rapt launchpad add <src>adds it on demand (--json). Theappsentry references the sources ("source": "helpdesk-tickets", relative to the launchpad.json), itsidcomes from the name of the folder, itsurl(local start) takes the first free port from 8081. The tile goes into the "Applications" group (or the "Applications" section of the first page of the first space): title of the application, intent<EntitySet>-manage(processfor a Worklist,analyzefor an Analytical List Page,createfor a Form Entry), icon and counter of the starting entity set. Idempotent: an application already present (same sources, or same id without sources) is not changed, nothing the user wrote is rewritten; an unreadable file is not overwritten. - Build:
rapt launchpad launchpad.json --out out/launchpadalso builds each application referenced bysourceinout/launchpad/apps/<id>;docker-compose.ymlbuilds them from this folder (one PostgreSQL each) and the image of the launchpad ignores it.sourceandbuildtogether are refused (LPD009);buildstays possible for an application built separately. - Two deployment modes: the launchpad with all its applications (
rapt launchpad), or one application alone (rapt build), which does not depend on the launchpad: its shell bar only shows if/launchpad/configanswers. The extension asks for the mode in Build the application… ("Launchpad (all the applications)" / "Application alone (standalone)"); Build the launchpad… builds the one of the workspace (rapt.hasLaunchpad).rapt devkeeps its development launchpad (D49).
- One launchpad per workspace, titled "Launchpad". The CLI looks for
- Why: the user creates applications, not configuration files; a single entry point per workspace, like the Fiori Launchpad of a system, and the choice of shipping one application alone stays open.
- Tests:
compiler/test/launchpad.test.ts(creation titled "Launchpad", idempotent addition without rewriting a changed tile, two projects of one folder in the same launchpad,rapt new,--no-launchpad,--launchpad, build of the applications with the launchpad, LPD009);vscode/test/rapt.test.ts(file of the workspace,rapt floorplanandrapt launchpad addin JSON).
D70 — Name: Open RAP Runtime
- Context: "rap-transpiler" described one step of the tool (abaplint transpiles the ABAP); the project is a runtime for RAP business objects outside SAP (OData V4, RAP managed runtime, UI, launchpad, MCP), with a compiler and a VS Code extension around it.
- Decision: the project is named Open RAP Runtime. The npm package of the command line is
open-rap-runtime, the libraries@open-rap/model,@open-rap/compiler,@open-rap/runtime(npm organizationopen-rap), the VS Code extensionopen-rap-runtime-vscode("Open RAP Runtime"). Unchanged, so that existing projects keep working: theraptcommand, therapt/folder of the projects, the.rapt/build folder, therapt_*tables, theZRAP_*ABAP objects. The URL of the website follows the name of the GitHub repository, renamedOpen-Rap-Runtime(https://clementringot.github.io/Open-Rap-Runtime/). - Why: "Open" says open source and without proprietary SAP libraries; "RAP Runtime" says what the application runs. The website states that the project is not affiliated with SAP SE.
- Tests: the whole suite (package names, generated applications with
vendor/open-rap-*, extension), the.vsixbuilt and itsrapt devchecked.
D71 — Feedback: a public feedback repository and a form on the website
_The issues moved to the repository itself once public: see D74._
- Context: the repository is private, so its issues are not open to the users; bug reports and feature requests had no place.
- Decision: a public repository,
ClementRingot/open-rap-runtime-feedback, holds the issues, with GitHub issue forms (bug_report.yml: component, description, steps, logs, version, environment;feature_request.yml: area, description, why, example, version; blank issues disabled). The website has afeedback.htmlpage: a form (type, component, title, description, steps or use case, version, environment) that opens a new issue of the right form with its fields filled in (GitHub fills an issue form field from the query parameter of its id); the author reviews it and submits it on GitHub. The page readskind,version,environment,component,titleanddescriptionfrom its own query string: the VS Code command RAP: Report a bug or request a feature… opens it with the version of the extension and the environment (VS Code, operating system). The help ofraptand the footer of every page of the website link to it. - Why: no server to run (a static page and GitHub), issues that everyone can follow and answer, and reports that come with the version and the environment.
- Tests:
vscode/test/rapt.test.ts(URL of the form); the page checked in Chromium (required fields, prefill from the query string, URL of the issue with the fields of the bug form, fields of the feature form, mobile without horizontal scrolling).
D72 — Extension builds: progress, floorplan prompts; the website serves the released .vsix
- Context: in VS Code, Build the application kept its progress notification spinning after the build: the message of the result (with its Open folder button) was awaited inside the progress, so the progress ended only once the message was answered; the user saw a build that never ended. Building the launchpad asks the floorplan of each application that has none, but the prompt named only the entity set, not the application. The website served a
.vsixbuilt frommain, whose version (that ofpackages/vscode/package.json) was not the released one. - Decision: the progress covers the call of
raptonly; the result is shown after it, without being awaited. Every application of the VS Code workspace (each project with a service definition) goes into the one launchpad of the workspace when the launchpad is built: they are added tolaunchpad.json(what is there is kept) before the build; only an application built alone (standalone) stays out of it. The choice reads "Launchpad of the workspace (3 applications)" with the names of the applications, never the name of a folder that could be taken for one of them, and "<application> alone (standalone)". The floorplan prompt names the application: the name of its workspace folder, with the folder when they differ ("Helpdesk (Worklist) (helpdesk) — Ticket"); building the launchpad still asks, application by application, the floorplan of every root entity set without one (all of them when no application has a floorplan). The website serves the.vsixof the latest GitHub release under its stable name, with its version shown on the page (%VSIX_VERSION%ofscripts/build-site.mjs); the Release workflow runs the Site workflow once the release exists (a release created with theGITHUB_TOKENdoes not trigger thereleaseevent). Without a release, the.vsixis built from the commit. The website and the links of the project follow the name of the repository,Open-Rap-Runtime. - Tests:
vscode/test/rapt.test.ts(name of a project in the prompts, applications of the workspace, URL of the feedback form); a launchpad of three projects (one already built, two without floorplan) under a folder with an accent built byrapt launchpadin 2 s.
D73 — The missing abapGit files are written before a build in VS Code
- Context: a project written by hand or by an AI agent can lack its abapGit files (
.abapgit.xml, the XML of the objects):rapt builddoes not need them, but the sources then do not import into an SAP system with abapGit, which is the purpose of the project. - Decision: Build the application (standalone or launchpad) and Build the launchpad run
rapt abapgiton each application before building it: the missing files are written, the existing ones are kept. The written files are listed in the log of the extension and announced in a message; the objects that cannot be completed (a table without source) are logged; a failure does not stop the build. The command line (rapt build,rapt launchpad) writes nothing into the sources: in a terminal or a CI,rapt abapgitis run explicitly. - Why: the build of the extension is the moment the user hands the application over; the sources that go with it must be importable as they are.
- Tests:
vscode/test/rapt.test.ts(missing files written, existing files kept, a second run writes nothing).
D74 — The repository is public: feedback goes to its own issues
- Context: the repository
ClementRingot/Open-RAP-Runtimebecomes public, so its issues are open to the users; the separate feedback repository of D71 is no longer needed. - Decision: the feedback form of the website (and so the VS Code command RAP: Report a bug or request a feature…) opens a pre-filled issue in the repository itself, with the same issue forms, now in
.github/ISSUE_TEMPLATE(bug report, feature request; blank issues disabled). The npm packages give the repository and its issues (repository,bugs). The repositoryopen-rap-runtime-feedbackpoints to the new place; its issues stay readable. The rest of D71 holds (fields filled from the query string, version and environment from the extension). - Tests:
compiler/test/docs.test.ts(no link to the former name of the repository).
D75 — The launchpad of the workspace in development
- Context:
rapt devruns one application with its development launchpad (D49); with several applications in a workspace (D69), the launchpad with all of them only existed as a build (rapt launchpad, then Docker). The commands of the extension were also active when they could not work (open the application before it serves, stop without a session). - Decision:
rapt launchpad dev <launchpad.json> [--port 8090] [--host] [--json]starts arapt devsession for each application withsource, on the port of itsurl, and serves the launchpad (its configuration resolved from the models of the sessions) on port 8090. The launchpad waits until every application is built, then follows their rebuilds; a change oflaunchpad.jsonadds, removes or restarts the sessions and regenerates the launchpad. Checks (LPD010): an application withbuildis not started (warning); a URL that is not local or without a port, a port taken twice or by the launchpad, no application with sources are errors. The files go to.rapt/launchpadnext tolaunchpad.json. In VS Code, RAP: Start the launchpad (rapt dev, all the applications) (palette, context menu and title bar oflaunchpad.json, view of the RAP objects) asks for the missing floorplans then runs it. The extension keeps a single session: starting an application or the launchpad stops the other, since both use the same.rapt/devand ports. Context keysrapt.devRunning,rapt.devReadyandrapt.devModegrey out Open the application until the session serves and Stop without a session; the launchpad commands need an application or alaunchpad.json(rapt.hasApp || rapt.hasLaunchpad). The roots of the sessions are real paths (no Windows 8.3 short name, whichfs.watchdoes not support). The regenerations run one at a time; one that throws (a file that cannot be written) is reported (launchpad-failed) and the next change oflaunchpad.jsonor of an application tries again. - Why: the launchpad is how the applications of a workspace are used together (navigation, counters); developing them one at a time hides the result, and Docker is too slow for each save.
- Tests:
compiler/test/launchpad-dev.test.ts(plan and LPD010, an application behind the launchpad, regeneration on a change oflaunchpad.json, ports freed on close, a launchpad that cannot be written then generated on the next change),vscode/test/rapt.test.ts(context keys, arguments of the sessions).
D76 — A Web API or a Fiori application: chosen at the creation, kept out of the launchpad
- Context: what makes a service a Web API is the type of its service binding (OData V4 - Web API,
BINDING_TYPE_CATEGORY1, D60).rapt newand New complete business object… only created UI bindings; a Web API was made by hand (rapt generate binding --binding-type webapi) and was then added to the launchpad like an application: a tile with no UI behind it, and a floorplan asked for nothing. A service with both a UI and a Web API binding, common on SAP, built the first one found (SRVD002). - Decision: the type of the binding stays the only source of truth, as on SAP; it is chosen at the creation and respected everywhere. business object…* asks "Fiori application (UI)" or "Web API" first;
rapt agent:bindingTypeofrapt_new_business_object) writes the service and binding with the names of SAP for an API (ZRT_API_TRAVEL,ZRT_API_TRAVEL_O4, category 1), no metadata extension (nor@Metadata.allowExtensions), and does not add the project to the launchpad. workspace before building or starting the launchpad) leaves a Web API out:webApi: true,added: false, no error,launchpad.jsonnot created for it. A tile oflaunchpad.jsonon a Web API is left out of the launchpad with the warning LPD011; the application itself can stay inapps(built and served behind the launchpad, at its service path). refuses to set one; the extension says so instead of asking. with it); without it, the UI binding is preferred over the Web API ones, with SRVD002 as an info naming the other one; several UI bindings remain a SRVD002 warning. meaning (labels: "UI: a Fiori application, in the launchpad", "Web API: for other systems, without UI, not in the launchpad"), shown by the wizard New RAP object…, whose Complete business object also asks it (Service). The quick picks (New RAP object (quick picks)…) ask the type of a binding too. The proposed name follows the service definition and the type, as SAP names them (ZRT_UI_TRAVEL→ZRT_UI_TRAVEL_O4orZRT_API_TRAVEL_O4,ZUI_ORDER→ZAPI_ORDER_O4), until the user types one.- Creation:
rapt new <src> <Entity> --binding-type webapi(VS Code: New complete business object… asks "Fiori application (UI)" or "Web API" first;rapt agent:bindingTypeofrapt_new_business_object) writes the service and binding with the names of SAP for an API (ZRT_API_TRAVEL,ZRT_API_TRAVEL_O4, category 1), no metadata extension (nor@Metadata.allowExtensions), and does not add the project to the launchpad. - Launchpad:
rapt launchpad add(and the extension, which adds the applications of the workspace before building or starting the launchpad) leaves a Web API out:webApi: true,added: false, no error,launchpad.jsonnot created for it. A tile oflaunchpad.jsonon a Web API is left out of the launchpad with the warning LPD011; the application itself can stay inapps(built and served behind the launchpad, at its service path). - Floorplan:
rapt floorplanlists no entity set for a Web API (webApi: true), and refuses to set one; the extension says so instead of asking. - Two bindings:
--binding <name>designates one of the bindings of the service (its type with it); without it, the UI binding is preferred over the Web API ones, with SRVD002 as an info naming the other one; several UI bindings remain a SRVD002 warning. - RAP Objects view: each service binding shows its kind,
UIorWeb API. - A binding alone: the catalog of
rapt generategives each value of--binding-typeits meaning (labels: "UI: a Fiori application, in the launchpad", "Web API: for other systems, without UI, not in the launchpad"), shown by the wizard New RAP object…, whose Complete business object also asks it (Service). The quick picks (New RAP object (quick picks)…) ask the type of a binding too. The proposed name follows the service definition and the type, as SAP names them (ZRT_UI_TRAVEL→ZRT_UI_TRAVEL_O4orZRT_API_TRAVEL_O4,ZUI_ORDER→ZAPI_ORDER_O4), until the user types one.
- Creation:
- Why: the choice is made where the developer thinks about it (what is the service for?), the result activates on SAP as is, and the launchpad never shows a tile that cannot open.
- Tests:
compiler/test/web-api-app.test.ts(names, files, model, floorplan, rapt new and rapt launchpad add, LPD011, the choice between two bindings),compiler/test/agent.test.ts(bindingType),vscode/test/rapt.test.ts(arguments of rapt new and of the wizard, names of a binding, kind of a binding, notice),vscode/test/wizard.test.ts(the page of the wizard in a browser: labels, proposed names, answers).
D77 — Versions and releases by Changesets
- Context: a release meant changing the version by hand in seven files (the five
package.json,RUNTIME_VERSION, the generator of the reference snapshot), then running the Release workflow with the same version; nothing tied a change to its version, and there was no changelog. LISA, another repository of the maintainer, releases with Changesets. - Decision: Changesets (
@changesets/cli, MIT), as in LISA, with one version for the five packages (afixedgroup; the VS Code extension is private: versioned, never published to npm by Changesets). ships (scripts/lib/versions.mjs): the sources of a package (not its tests), the grammars and build scripts of the extension,docs/(copied into the compiler), the installed fields of a publishedpackage.json(dependencies,bin,exports,contributes…). The CI refuses a pull request without one (scripts/require-changeset.mjs);pnpm changeset add --emptydeclares a change that must not be released; the Version packages pull request, and a pull request that bumps the version itself, are exempt. pull request up to date:pnpm changeset:versionbumps the packages, writes theirCHANGELOG.md, copies the version into the files that carry it (scripts/sync-versions.mjs), updates the lockfile and checks the result. committed versionvX.Y.Zon the merge commit (when not tagged yet, nor being released) and runsrelease.ymlon the tag. Unlike LISA, no GitHub App is needed for that: the tag is created with theGITHUB_TOKEN(it does not start the tag trigger, so no second run) and theworkflow_dispatchit sends does start the workflow. An optional App gives the CI to the Version packages pull request. that the tag is the committed version instead of writing the version at release time. The notes of the GitHub release are the sections of the version in the changelogs, merged (scripts/release-notes.mjs).- Each pull request that changes what ships adds a changeset (
pnpm changeset). What ships (scripts/lib/versions.mjs): the sources of a package (not its tests), the grammars and build scripts of the extension,docs/(copied into the compiler), the installed fields of a publishedpackage.json(dependencies,bin,exports,contributes…). The CI refuses a pull request without one (scripts/require-changeset.mjs);pnpm changeset add --emptydeclares a change that must not be released; the Version packages pull request, and a pull request that bumps the version itself, are exempt. - On
main, the Changesets workflow (changesets/action) keeps the Version packages pull request up to date:pnpm changeset:versionbumps the packages, writes theirCHANGELOG.md, copies the version into the files that carry it (scripts/sync-versions.mjs), updates the lockfile and checks the result. - Its merge releases: without pending changesets,
scripts/release-version.mjstags the committed versionvX.Y.Zon the merge commit (when not tagged yet, nor being released) and runsrelease.ymlon the tag. Unlike LISA, no GitHub App is needed for that: the tag is created with theGITHUB_TOKEN(it does not start the tag trigger, so no second run) and theworkflow_dispatchit sends does start the workflow. An optional App gives the CI to the Version packages pull request. - One version everywhere:
pnpm check:version(CI) fails on a drift;release.ymlchecks that the tag is the committed version instead of writing the version at release time. The notes of the GitHub release are the sections of the version in the changelogs, merged (scripts/release-notes.mjs).
- Each pull request that changes what ships adds a changeset (
- Why: the only human step of a release is merging a pull request that shows the version and its changelog; a change cannot be merged without saying whether and how it is released; the version can no longer differ between the files.
- Tests:
scripts/lib/versions.test.mjs(the files of the version,sync-versions.mjsandcheck-version-sync.mjswith a tag, what ships, changesets, the notes merged from several changelogs);changeset versionchecked on a copy of the repository (the five packages bumped together, the mirrors copied).
D78 — Publishing without tokens: trusted publishing
- Context:
release.ymlpublished with three long-lived secrets (NPM_TOKEN,VSCE_PAT,OVSX_PAT). A stolen token publishes anything, until someone revokes it; the tokens also expire and have to be renewed. LISA already publishes to npm by trusted publishing. - Decision: every registry trusts the workflow
release.ymlof this repository by OIDC; the jobs haveid-token: writeand no secret. 10), withoutregistry-urlinsetup-node(it writes an.npmrcwaiting for a token). The four archives already checked (pnpm pack:workspace:*replaced by the version) are published bynpm publish <archive>: npm exchanges the identity token, pnpm does not. The provenance is attested automatically. A version already on npm is skipped. the.vsix), with--skip-duplicate; the publisher declares a Trusted Publishing policy. The extension is published by the publisherabaperof the maintainer (it wasclementringotinpackage.json, a publisher that does not exist on the Marketplace): its ID becomesabaper.open-rap-runtime-vscode. only: EPL-2.0, never distributed), with--skip-duplicate; the namespaceabaperdeclares its trusted publisher.PUBLISH_VS_MARKETPLACEandPUBLISH_OPEN_VSXaretrue, so that a release does not fail before their trusted publisher is declared. npm and the GitHub release always run. (D77), which only opens the Version packages pull request.- npm: npm 11.21.1 (trusted publishing needs 11.5.1 or later; Node.js 22 comes with npm 10), without
registry-urlinsetup-node(it writes an.npmrcwaiting for a token). The four archives already checked (pnpm pack:workspace:*replaced by the version) are published bynpm publish <archive>: npm exchanges the identity token, pnpm does not. The provenance is attested automatically. A version already on npm is skipped. - Visual Studio Marketplace:
vsce publish --oidc(@vscode/vsce4.1.0, which also builds the.vsix), with--skip-duplicate; the publisher declares a Trusted Publishing policy. The extension is published by the publisherabaperof the maintainer (it wasclementringotinpackage.json, a publisher that does not exist on the Marketplace): its ID becomesabaper.open-rap-runtime-vscode. - Open VSX:
ovsx publish --trusted-publishing(ovsx1.3.0, run bynpxin the CI only: EPL-2.0, never distributed), with--skip-duplicate; the namespaceabaperdeclares its trusted publisher. - The Marketplace and Open VSX steps run when the repository variables
PUBLISH_VS_MARKETPLACEandPUBLISH_OPEN_VSXaretrue, so that a release does not fail before their trusted publisher is declared. npm and the GitHub release always run. - The only stored credential left is the private key of the GitHub App of the release train (D77), which only opens the Version packages pull request.
- npm: npm 11.21.1 (trusted publishing needs 11.5.1 or later; Node.js 22 comes with npm 10), without
- Why: nothing to steal nor to renew; a version can only come from this workflow on this repository, which the npm provenance shows; the release can be re-run (each registry skips a version it has).
- Tests: the
.vsixbuilt with@vscode/vsce4.1.0 (the embeddedraptchecks the fixture); the options--oidc(vsce) and--trusted-publishing(ovsx) checked in the help of the pinned versions; the workflow runs on the next release (npm needs its trusted publisher declared first, DEPLOYMENT.md).
D79 — SAP Fiori elements protocol conformance, without SAPUI5
- Context: Open RAP Runtime aims at the experience of RAP with SAP Fiori elements, but nothing showed which requests of Fiori elements the service answers.
sap.fe,sap.ovpand the flexible programming model are part of SAPUI5, under the SAP Developer License: it does not clearly allow running them in the public CI of the project (the software is used on devices the licensee owns or controls; no publication of information on SAP software without written consent; no reverse engineering). The OData V4 protocol (OASIS) and the vocabularies of SAP (Common,UI…, Apache-2.0) are public. - Decision: test the protocol, that is our server, not SAPUI5.
fe-protocol.test.tsagainst the fixtures (travel,travel-draft) on PGlite, without network: requests (single or in a multipart$batch),{{name}}placeholders (seeded keysT1…, the namespaceNS, values captured from a response), and the structure of the responses: status, properties present, control annotations, headers, severity and target ofsap-messages. Values (match) are only checked by the cases written by hand, on the data of the fixtures. A case that cannot pass yet names the decision that will fix it ("fails": "D81"): it runs withit.fails, so a case that starts passing fails the test until its marker is removed. "specification"): the draft List Report (Editing Status filters,SiblingEntity) and the draft Object Page (CSRF, Edit/Prepare/Activate,SiblingEntity,Preparerunning the validations,SAP__Messages, determinations and actions on a draft). 4 of the 13 cases passed, 9 waited for D81 (8 pass after D81 a); the filters of the Editing Status are markedconfirm, to check with a HAR. fixture on their own SAP BTP trial (SAP backend, SAPUI5 under the license of SAP). The HAR stays with them:scripts/fe-har-to-cases.mjs, run locally, writes the shape of its requests (method, path, system query options, OData headers, batch structure, request bodies; keys as placeholders) and the structure of its responses; never cookies, tokens, host names, message texts nor response values.source: "har"with the SAP BTP release.rapt dev --fe-checkprints the URLs to point a Fiori elements application to (the service path is the one of SAP BTP,/sap/opu/odata4/…);rapt dev` serves no SAPUI5 and the project publishes no result obtained with it. written by the project) could be added; the agreement would go to LICENSES.md.- Protocol cases:
packages/runtime/test/fe-protocol/cases/*.json, replayed byfe-protocol.test.tsagainst the fixtures (travel,travel-draft) on PGlite, without network: requests (single or in a multipart$batch),{{name}}placeholders (seeded keysT1…, the namespaceNS, values captured from a response), and the structure of the responses: status, properties present, control annotations, headers, severity and target ofsap-messages. Values (match) are only checked by the cases written by hand, on the data of the fixtures. A case that cannot pass yet names the decision that will fix it ("fails": "D81"): it runs withit.fails, so a case that starts passing fails the test until its marker is removed. - First cases, written from the specification and the public vocabularies (
source: "specification"): the draft List Report (Editing Status filters,SiblingEntity) and the draft Object Page (CSRF, Edit/Prepare/Activate,SiblingEntity,Preparerunning the validations,SAP__Messages, determinations and actions on a draft). 4 of the 13 cases passed, 9 waited for D81 (8 pass after D81 a); the filters of the Editing Status are markedconfirm, to check with a HAR. - Cases from the SAP BTP trial: the user records a HAR of the Fiori elements preview of a fixture on their own SAP BTP trial (SAP backend, SAPUI5 under the license of SAP). The HAR stays with them:
scripts/fe-har-to-cases.mjs, run locally, writes the shape of its requests (method, path, system query options, OData headers, batch structure, request bodies; keys as placeholders) and the structure of its responses; never cookies, tokens, host names, message texts nor response values.source: "har"with the SAP BTP release. - The real
sap.fe: only run by the user, locally, under their own license.rapt dev --fe-checkprints the URLs to point a Fiori elements application to (the service path is the one of SAP BTP,/sap/opu/odata4/…);rapt devserves no SAPUI5 and the project publishes no result obtained with it. - With a written agreement of SAP, a CI job running
sap.fe(pinned version, test applications written by the project) could be added; the agreement would go to LICENSES.md.
- Protocol cases:
- Why: the protocol is what an application of Fiori elements needs from the service; testing it measures Open RAP Runtime without loading, distributing or publishing anything of SAPUI5. The failing cases turn the gaps of the draft into tests, and order the work (phase 0 of ROADMAP.md); their rate feeds the conformance metrics (D100).
- Tests:
fe-protocol.test.ts(the case files are checked: fixtures, unique ids,failsnaming a decision, one request or batch per step);scripts/lib/fe-har.test.mjs(a synthetic HAR: service root, multipart, placeholders, captures, nothing secret kept, the command line);dev.test.ts(--fe-check: one event per session, URLs that answer).
D80 — The gaps of abaplint fixed in our layers, without patch nor upstream issue
- Context: KNOWN_GAPS.md listed gaps of
@abaplint/transpilerand@abaplint/runtime. Each one was reproduced again on the latest versions (2.14.33, core 2.120.107, to which the project moved first) with a minimal program run on the database client of abaplint: the packed arithmetic through JavaScript numbers; the classic SQL writes passing packed values as JavaScript numbers (12345678901234567000for12345678901234567890.12);DELETE dbtab FROM @wasent without condition (every row deleted); the inline declaration ofSUM,AVG,COUNT( DISTINCT … )typed void;SELECT … ENDSELECTwith a field list filling the target with the whole row; anint8bound ofLOOP AT … FROM/TO("Cannot mix BigInt"); an enumerated object converted to text giving its base value (1instead ofM). The maintainer chose not to report them upstream, and to fix what can be fixed in the project, without patching abaplint. - Decision: the fixes go in our own layers; rule 3 of AGENTS.md says it.
INSERT INTO dbtab VALUES @wa, in the saver): the rewriting pass calls the kernel (sql_write_table), which reads the rows by the columns of the table with their exact value and writes them likeMAPPING FROM ENTITY(same code: sy-subrc 4 for a missing or duplicate row, a duplicate inFROM TABLEis a runtime error, sy-dbcnt).DELETE dbtab FROM @wadeletes the row of its key.UPDATE … SET,DELETE FROM … WHERE, a subquery or a dynamic table stay with the transpiler.int8, likeMAX/MINalready (D26); the other untyped results keep ABP009. TABLE OF target, thenLOOP AT … INTO target, itsENDSELECTwrittenENDLOOP; an inline target, a list of targets,PACKAGE SIZEandAPPENDINGare refused (ABP007). clean-room base makes the check run through the behavior pools) finds the operands that are enumerated objects (variables by their type; constants, which abaplint types as their base type, by their declaration) converted to text: an embedded expression of a string template, an operand of&&,CONV string|c( … ), an assignment to a character-like variable. They becomezrap_eml=>enum_text( value = CONV <base>( x ) members = … ): the name of the constant, upper case,<illegal enum value>for another value, as in ABAP. expression rewritten),UPDATE … SET` of packed values, the cursors (not ABAP Cloud).- Classic SQL writes (
INSERT|UPDATE|MODIFY|DELETE dbtab FROM @wa,FROM TABLE @itab,INSERT INTO dbtab VALUES @wa, in the saver): the rewriting pass calls the kernel (sql_write_table), which reads the rows by the columns of the table with their exact value and writes them likeMAPPING FROM ENTITY(same code: sy-subrc 4 for a missing or duplicate row, a duplicate inFROM TABLEis a runtime error, sy-dbcnt).DELETE dbtab FROM @wadeletes the row of its key.UPDATE … SET,DELETE FROM … WHERE, a subquery or a dynamic table stay with the transpiler. - Aggregates in an inline declaration:
SUMgets the type of the column,AVGf,COUNTint8, likeMAX/MINalready (D26); the other untyped results keep ABP009. SELECT … ENDSELECTwith a field list:INTO TABLEof a table declaredLIKE STANDARD TABLE OF target, thenLOOP AT … INTO target, itsENDSELECTwrittenENDLOOP; an inline target, a list of targets,PACKAGE SIZEandAPPENDINGare refused (ABP007).LOOP AT … FROM/TO: the bounds becomeCONV i( … ).- Enumerated objects as text: after the rewrite, the syntax of the transpiler's registry (the clean-room base makes the check run through the behavior pools) finds the operands that are enumerated objects (variables by their type; constants, which abaplint types as their base type, by their declaration) converted to text: an embedded expression of a string template, an operand of
&&,CONV string|c( … ), an assignment to a character-like variable. They becomezrap_eml=>enum_text( value = CONV <base>( x ) members = … ): the name of the constant, upper case,<illegal enum value>for another value, as in ABAP. - Left as known gaps: the packed arithmetic of the runtime (it would need every arithmetic expression rewritten),
UPDATE … SETof packed values, the cursors (not ABAP Cloud).
- Classic SQL writes (
- Why: the gaps are fixed now, for the users, without waiting for releases of abaplint nor forking it; each fix is local, tested, and goes away by removing its rewrite if abaplint fixes the gap one day. Patching published packages would make each version upgrade a merge.
- Tests:
abap-generate.test.ts(the rewrites: kernel writes, typed aggregates, the SELECT loop, the bounds, the enumerated objects, the forms still refused);rap-variant-sql-writes.test.ts(a 30-digit amount and a 7-decimal stamp written exactly,DELETE … FROM @wadeleting one row, a duplicate refused with sy-subrc 4);rap-variant-sql.test.ts(SUMinline, a SELECT loop with a field list, anint8bound, enumerated objects as text, run).
D81 — Complete draft protocol (a): SiblingEntity
- Context: SAP Fiori elements finds the draft of an active instance, and the other way round, with the navigation
SiblingEntityof the draft protocol, and filters the List Report with it (Editing Status All:IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null). The service had no such navigation: the protocol cases of D79 failed, and the OpenUI5 UI filtered onDraftAdministrativeData/InProcessByUserwith the name of the user (D58). - Decision: D81 is delivered in parts; part (a) is
SiblingEntity. ON pairs are its keys withoutIsActiveEntity, and a flagsiblingadds the conditionIsActiveEntityopposite. Its target is read with the visibility of the drafts of the user (D54, D59): the sibling of an active instance is the draft of the user, none when another user edits it.$orderby(SiblingEntity/IsActiveEntity eq null) and in$expand. 404). user*:HasDraftEntity eq true and SiblingEntity/IsActiveEntity eq null), without the name of the user.- Each exposed entity of a draft BO gets the to-one association
SiblingEntityto itself: the ON pairs are its keys withoutIsActiveEntity, and a flagsiblingadds the conditionIsActiveEntityopposite. Its target is read with the visibility of the drafts of the user (D54, D59): the sibling of an active instance is the draft of the user, none when another user edits it. - Supported in a path (
Travel(…,IsActiveEntity=true)/SiblingEntity), in$filterand$orderby(SiblingEntity/IsActiveEntity eq null) and in$expand. - A single-valued navigation without target answers 204 No Content, as OData V4 says (it was 404).
- The OpenUI5 UI filters the Editing Status with
SiblingEntity(All, and Locked by another user:HasDraftEntity eq true and SiblingEntity/IsActiveEntity eq null), without the name of the user.
- Each exposed entity of a draft BO gets the to-one association
- Why: the filter of the List Report of Fiori elements works as on SAP BTP, and the UI uses the protocol instead of a workaround; the visibility rule of the drafts is the one of the reads.
- Tests:
draft.test.ts(sibling of the active instance and of the draft, the view of another user, the All and Locked filters); the protocol casesmetadata-sibling-entity,editing-status-all,sibling-entity-of-active,sibling-entity-expandpass (8 of 13);ui-draft.test.tsin the browser.
D81 — Complete draft protocol (b): the logic of the BO on the draft
- Context: the draft was written in its tables without the logic of the BO (D54): the determinations ran on activation only,
Preparereturned the draft without a check, an action of the application on a draft answered 501. SAP Fiori elements expects the draft to behave like the BO: a total recomputed while typing,Preparethat validates before activation, an action on the draft being edited. - Decision: the logic of the BO runs on the draft, in the managed runtime itself. transaction is created on the connection of the LUW (
RapRuntime.shadow), and the draft tree is put in its buffer without change events: each draft instance as a change of its active instance (its image in the database), or as a creation; the active children the draft removed as deletions. The handlers called by the kernel see this transaction (the context of the LUW), so their EML reads and changes the draft. a PATCH as an update event of its fields, a creation (root, child, inline children) as a create event, the deletion of a child and an instance action by the managed runtime itself (delete,execute). The determinations on modify follow, by rounds, as in any LUW. Prepare { … }names (Alias~namefor a child entity), for the instances of the draft changed since their active image or created; their messages, errors included, come back insap-messages` with status 200, and the draft is kept. The compiler reads the list; a name the entity does not define is BDEF030. instances); what the handlers did in the database is rolled back (a savepoint): only the draft tables change, the active instances never. the whole save sequence.- A transaction of its own whose buffer holds the draft. For each request on a draft, a transaction is created on the connection of the LUW (
RapRuntime.shadow), and the draft tree is put in its buffer without change events: each draft instance as a change of its active instance (its image in the database), or as a creation; the active children the draft removed as deletions. The handlers called by the kernel see this transaction (the context of the LUW), so their EML reads and changes the draft. - The change, then the determinations. The change of the request is recorded in this buffer: a PATCH as an update event of its fields, a creation (root, child, inline children) as a create event, the deletion of a child and an instance action by the managed runtime itself (
delete,execute). The determinations on modify follow, by rounds, as in any LUW. Prepareruns the determinations (on save) and validations thatdraft determine action Prepare { … }names (Alias~namefor a child entity), for the instances of the draft changed since their active image or created; their messages, errors included, come back insap-messageswith status 200, and the draft is kept. The compiler reads the list; a name the entity does not define is BDEF030.- The buffer is written back to the draft tables (changed fields, created and removed instances); what the handlers did in the database is rolled back (a savepoint): only the draft tables change, the active instances never.
- Activation is unchanged: the managed runtime applies the draft in the LUW of the request, with the whole save sequence.
- A transaction of its own whose buffer holds the draft. For each request on a draft, a transaction is created on the connection of the LUW (
- Why: the same handlers, the same buffer and the same trigger rules on the draft and on the active instances, without a second implementation of RAP; the draft tables stay the store.
- Tests:
draft.test.ts(determinations on create and change of the draft and of its children,Preparewith its message, an action on a draft, the deletion of an active child in an edited draft, the active instance untouched); the protocol casesprepare-runs-validations,determination-on-draft-change,action-on-draftpass (11 of 13).
D81 — Complete draft protocol (c): state messages
- Context: SAP Fiori elements shows the messages of the validations of a draft next to its fields, and keeps them while the user corrects the draft: they are state messages, read in the property
SAP__Messagesthat the annotationCommon.Messagespoints to. They were only returned as transition messages. - Decision: of the complex type
SAP__Message(code,message,target,additionalTargets,transition,numericSeverity,longtextUrl), and the annotationCommon.Messages. Like the feature control, the property is computed by the runtime: an active instance has none. draft, instance, validation and%state_area): they replace the previous messages of the same validation on the same instance; a reported entry with a%state_areaand no message removes the messages of its area. The target is relative to the instance (BeginDate). activation.- The draft entity types of a service with a UI have the property
SAP__Messages, a collection of the complex typeSAP__Message(code,message,target,additionalTargets,transition,numericSeverity,longtextUrl), and the annotationCommon.Messages. Like the feature control, the property is computed by the runtime: an active instance has none. Preparestores the messages of the validations it ran (tablerapt_draft_message, per draft, instance, validation and%state_area): they replace the previous messages of the same validation on the same instance; a reported entry with a%state_areaand no message removes the messages of its area. The target is relative to the instance (BeginDate).- The messages go with the draft: removed with an instance of the draft, its discard or its activation.
- The draft entity types of a service with a UI have the property
- Why: the state messages of RAP, with their invalidation rules, on the store of the draft.
- Tests:
draft.test.ts(a message stored by Prepare with its target, none on an active instance, removed when the validation runs again without error, the annotation); the protocol casesmetadata-messagesandstate-messages-on-draftpass: the 13 cases of D79 pass.
D82 — Nested $expand, any and all
- Context: SAP Fiori elements expands several levels (a child and its own associations) and filters on collections (
_Booking/any(b: …)); the service answered 501. The subquery of a$filteron a to-one navigation also read its target without its access controls (a known gap of D35). - Decision: page (no N+1), with the options of each level; at most 5 levels (400 beyond), not on a custom entity.
NOT EXISTS (… AND NOT predicate)(all, true for an empty collection) on the view of the target, with the join of the navigation, the drafts of the user and the access controls of the target; a member that starts with the variable is the instance of the collection, the others the instance of the query ($it);any()without lambda. their target too.$expandis recursive: one query per navigation and per level for all the rows of the page (no N+1), with the options of each level; at most 5 levels (400 beyond), not on a custom entity.anyandallon a collection navigation of the query:EXISTS(any) andNOT EXISTS (… AND NOT predicate)(all, true for an empty collection) on the view of the target, with the join of the navigation, the drafts of the user and the access controls of the target; a member that starts with the variable is the instance of the collection, the others the instance of the query ($it);any()without lambda.- The subqueries of a
$filteror$orderbyon a to-one navigation apply the access controls of their target too. - JSON batch and
$valuestay for later (part of the provisional D83).
- Why: the requests of Fiori elements on lists and Object Pages, translated to SQL without reading the instances one by one, and the access controls applied wherever a target is read.
- Tests:
odata-read.test.ts(two and three levels, five levels and refusal beyond,anywith and without lambda,allon empty collections,$it,notand combination, refusal on a to-one navigation). The access controls of the subqueries are not isolated by a test: in the fixture, the DCL of the bookings follows their travel, so both sides of a navigation filter the same rows.
D83 — Recording the Fiori elements protocol on the SAP BTP trial: guided, on a renamed copy
- Context: the cases of D79 were to come from HAR files recorded by hand in the DevTools, on the SAP BTP ABAP trial. Before building on it, the option was weighed against the others (a specification only, replaying a
.httpfile, a browser driving SAP Fiori elements alone, a recording guided by a script). Two facts weigh: the trial is a system shared by its users, whose objects need a suffix of their own (the SAP tutorials name them…_###), and a trial account lasts 30 days by default, so the recording is done again with each account and each release. A raw HAR also holds cookies, tokens and the code of SAPUI5. - Decision: keep the trial as the oracle (what Fiori elements sends and what SAP answers), with a recording guided by a script, on a copy renamed for the shared system. objects (Z, Y) all end with the suffix, in their file names and in every reference (CDS, BDEF, ABAP, XML), in the case of each reference. A name too long for its type (16 characters for a table, 20 for a message class, 10 for an authorization object, 30 otherwise) keeps its start; a collision is an error. The project is not changed. their own browser session kept in
~/.rapt/): it opens the preview, the user signs in, then plays each scenario the terminal describes and presses Enter. Each scenario is recorded in its own HAR, limited to/sap/opu/odata4/while recording (no SAPUI5 resource is written), turned at once into a case file (trial-<scenario>-har.json) and deleted. The user drives the UI: the script never drives SAP Fiori elements itself (fragile, and closer to what its license restricts). of the cases. a.httpfile against the trial is left to the round trip (D99).rapt abapgit <src> --suffix XYZ --out <dir>writes a copy of the abapGit files whose objects (Z, Y) all end with the suffix, in their file names and in every reference (CDS, BDEF, ABAP, XML), in the case of each reference. A name too long for its type (16 characters for a table, 20 for a message class, 10 for an authorization object, 30 otherwise) keeps its start; a collision is an error. The project is not changed.scripts/fe-record-trial.mjs, run by the user on their machine (Playwright, Apache-2.0, their own browser session kept in~/.rapt/): it opens the preview, the user signs in, then plays each scenario the terminal describes and presses Enter. Each scenario is recorded in its own HAR, limited to/sap/opu/odata4/while recording (no SAPUI5 resource is written), turned at once into a case file (trial-<scenario>-har.json) and deleted. The user drives the UI: the script never drives SAP Fiori elements itself (fragile, and closer to what its license restricts).- The namespace of the service, which changes with the suffix, becomes the placeholder
{{NS}}of the cases. scripts/fe-har-to-cases.mjsstays for a HAR recorded by hand; replaying the known requests of a.httpfile against the trial is left to the round trip (D99).
- Why: the same scenarios, recorded the same way at each release, with as little sensitive data on the disk as possible; the cases keep the shape of standard OData requests, re-expressed on the fixtures of the project.
- Not yet possible: the scenarios need the draft variant of the fixture on the trial, which only exists in the tests (its draft tables are not DDIC objects), and the authorization object
ZAO_TRAVLof the fixture names the fieldZAGENCY, which the repository does not define: both are for the round trip (D99). - Tests:
rename.test.ts(names, lengths, case, collisions, a copy that compiles, the project unchanged);fe-record.test.mjs(a headless browser on a local page that plays the preview: one case file, the service only, no cookie nor resource, the HAR deleted);fe-har.test.mjs(the namespace placeholder).
D84 — Round trip to the SAP BTP trial (a): the repository for the trial
- Context: D99 of the plan compares Open RAP Runtime with SAP BTP on the same sources, and D83 records the protocol of Fiori elements on the trial. Three things kept the fixtures from being imported there: the draft variant only existed in the tests; its draft tables are created by Open RAP Runtime and are not DDIC objects; and a trial user cannot be granted authorizations of their own (the SAP tutorials replace the access conditions by
true), while the Travel fixture checks the authorization objectZAO_TRAVLin its handlers and its access controls. The fieldZAGENCYof this object is also not defined by the fixture. - Decision: replacements per file (
nullremoves a file).draftis the draft BO of D54 (the tests buildDRAFT_CHANGESfrom it);trialleaves the authorizations out:AUTHORITY-CHECKbecomessy-subrc = 0.on the same line, the access conditions an unconditionalgrant select, and the authorization object is removed. BDEFs name and the project does not define, as the ABAP keyword documentation asks: the client first, a field per element of the CDS entity with its name and type (its data element, else the built-in type), the currency or unit reference of the amounts, and the admin includeSYCH_BDL_DRAFT_ADMIN_INC(group%ADMIN). The project itself is not changed: Open RAP Runtime keeps creating its draft tables.fixtures/travel), applies variants (defaultdraft,trial), writes the renamed repository with its draft tables, anexpected.json(variants, objects and their new names, the service path) and aREADME.mdof the steps on the trial (abapGit for ADT, activation, preview, recording with D83,$metadata).conformance/btp/<release>/, the sources SAP must refuse (fixtures/negative/), the requests of reference in a.httpfile, and their comparison with Open RAP Runtime.fixtures/variants.json: the variants needed both by the tests and on SAP, as exact replacements per file (nullremoves a file).draftis the draft BO of D54 (the tests buildDRAFT_CHANGESfrom it);trialleaves the authorizations out:AUTHORITY-CHECKbecomessy-subrc = 0.on the same line, the access conditions an unconditionalgrant select, and the authorization object is removed.- Draft tables for SAP:
rapt abapgit --suffix --outadds to the copy the draft tables the BDEFs name and the project does not define, as the ABAP keyword documentation asks: the client first, a field per element of the CDS entity with its name and type (its data element, else the built-in type), the currency or unit reference of the amounts, and the admin includeSYCH_BDL_DRAFT_ADMIN_INC(group%ADMIN). The project itself is not changed: Open RAP Runtime keeps creating its draft tables. scripts/btp-roundtrip.mjs --suffix CR1 --out <dir>copies a fixture (defaultfixtures/travel), applies variants (defaultdraft,trial), writes the renamed repository with its draft tables, anexpected.json(variants, objects and their new names, the service path) and aREADME.mdof the steps on the trial (abapGit for ADT, activation, preview, recording with D83,$metadata).- Still to come (D99 b): the activation results and the
$metadataof SAP kept inconformance/btp/<release>/, the sources SAP must refuse (fixtures/negative/), the requests of reference in a.httpfile, and their comparison with Open RAP Runtime.
- Why: one definition of each variant, for the tests and for SAP; the user only pushes, pulls and activates.
- Tests:
roundtrip.test.mjs(the variants: order, removal, text not found, unknown variant, applied to the fixture; the repository: renamed files, draft tables with client, elements, reference fields and admin include, no authorization,expected.json,README.md, an existing folder refused); the draft tests run on the variant read fromfixtures/variants.json. The repository is not activated on SAP by the tests: the first activation on the trial will confirm or correct the draft tables and thetrialvariant (KNOWN_GAPS.md).
D85 — First pull and activation on the SAP BTP trial: abapGit XML, total etag, authorizations
- Context: the first pull of the Travel fixture on the SAP BTP ABAP trial (2611, D84) imported 20 objects of 23. The two metadata extensions failed with
The description is missing for …and the service binding withObject description is missing, thenImport of object … failed. Their XML put the fields directly under<DDLX>and<SRVB>. The abapGit of SAP BTP writes them in sub-structures (SAP-samples/abap-platform-rap-workshops,SAP-samples/abap-partner-reference-application): a DDLX hasMETADATA(NAME,DESCRIPTION,MASTER_LANGUAGE); a SRVB hasMETADATA(NAME,TYPESRVB/SVB,DESCRIPTION,LANGUAGE,MASTER_LANGUAGE) andCONTENT(BIND_TYPE,BIND_TYPE_CATEGORY1 for a Web API only,BIND_TYPE_VERSION, and per service its definition inSERVICE_CONTENT/item/SRVD_REF). The flat XML of BDEF and SRVD is the one SAP writes, and they imported. - Decision:
rapt newandrapt generate … binding. A binding is written unpublished, withoutABAP_LANGU_VERSION(that of the package applies). (…/srvd/sources/zrt_ui_travelcr1); a name after a namespace (/DMO/ZRT_X) is still left alone.ddlxXmlandsrvbXml(authoring/abapgit.ts) write this format, forrapt abapgit,rapt newandrapt generate … binding. A binding is written unpublished, withoutABAP_LANGU_VERSION(that of the package applies).readSrvbXmlreads both formats; the VS Code extension reads both categories.- The DDLX and SRVB of
fixtures/are rewritten in this format. rapt abapgit --suffix(D83) renames a name in a path too, as theURIofSRVD_REF(…/srvd/sources/zrt_ui_travelcr1); a name after a namespace (/DMO/ZRT_X) is still left alone.
- Context (activation): once pulled, the draft and trial variants of the fixture did not activate: "total".
ontotal etag LastChangedAtwritten on its own line: in BDLtotal etagis an addition oflock master(lock master total etag LastChangedAt); language version.on the sixsy-subrc = 0.of thetrialvariant; "REQUESTED_AUTHORIZATIONS" does not have a component called "%ASSOC-_BOOKING".and the same forRESULT: the authorization types of SAP have no%assocfor the to-child association_Booking { create; }; its creation is authorized as an update of the travel (*RAP - Authorization* of the ABAP keyword documentation). "Prepare").for the booking.- BDEF:
"( | changedocuments | early | extensible | late | with | {" was expected, not "total".ontotal etag LastChangedAtwritten on its own line: in BDLtotal etagis an addition oflock master(lock master total etag LastChangedAt); - behavior pool:
Only reads can be performed on the field "SY-SUBRC" in the current ABAP language version.on the sixsy-subrc = 0.of thetrialvariant; - behavior pool:
No component exists with the name "%ASSOC-_BOOKING".,The data object "REQUESTED_AUTHORIZATIONS" does not have a component called "%ASSOC-_BOOKING".and the same forRESULT: the authorization types of SAP have no%assocfor the to-child association_Booking { create; }; its creation is authorized as an update of the travel (RAP - Authorization of the ABAP keyword documentation). - warning:
Validation "validateMandatory" is not assigned to any determine action (not even "Prepare").for the booking.
- BDEF:
- Decision (activation): variant writes
lock master total etag LastChangedAt. after it byif_abap_behv=>auth-allowed: it no longer writessy-subrc. have%assoc(the failed responses keep it); the runtime asks the authorization of a creation by association as an update of its source (%update). The behavior pool of the fixture no longer names%assoc-_Booking. Open RAP Runtime has noauthorization:addition per association (create ( authorization : … )), which would give it its own indicator.- BDEF031:
total etaganywhere but right afterlock masteris an error; thedraftvariant writeslock master total etag LastChangedAt. - The
trialvariant replaces eachAUTHORITY-CHECKand theCOND #( WHEN sy-subrc = 0 … )after it byif_abap_behv=>auth-allowed: it no longer writessy-subrc. - The authorization types (
ts_eN_gauth_req,ts_eN_iauth_req,ts_eN_iauth_r) no longer have%assoc(the failed responses keep it); the runtime asks the authorization of a creation by association as an update of its source (%update). The behavior pool of the fixture no longer names%assoc-_Booking. Open RAP Runtime has noauthorization:addition per association (create ( authorization : … )), which would give it its own indicator. - The
Prepareof thedraftvariant also runsBooking~validateMandatory.
- BDEF031:
- Not done:
rapt abapgitstill never changes an existing XML file: a project written by an earlier version keeps its flat DDLX and SRVB until they are deleted and written again. The warnings of the secondary keyentity(READ TABLE … WITH KEY TravelUUID = …) are left. - Tests:
abapgit-format.test.ts(both writers, the Web API category, the flat binding still read, no flat DDLX or SRVB left infixtures/);web-api-app.test.ts,web-api.test.ts,rapt.test.tson the new category;rename.test.ts(the path renamed, the namespace not);ir.test.ts(BDEF031);abap-generate.test.ts(no%associn the authorization types);roundtrip.test.mjs(the variants:lock master total etag, nosy-subrcwritten, no%assoc-_Booking);rap-authorizations.test.ts(the creation of bookings by the update authorization of the travel).
D86 — use side effects and the value help of the draft fixture for the scenarios of Fiori elements
- Context: in the Fiori elements preview of the draft fixture on the SAP BTP trial (D85), the scenario
value-helpcould not be played: no field has a value help. In the scenarioside-effects, Total Price was updated only on Save, not when Booking Fee was left. Both follow from the sources: the fixture has no@Consumption.valueHelpDefinitionand noside effects. On SAP a projection BDEF exposes the side effects of its base only with the headeruse side effects;. Open RAP Runtime ignored this header (BDEF003) and wrote the side effects of the base in the$metadataof every projection. - Decision: it the
$metadataof a projection has noCommon.SideEffects, as on SAP. the draft tests) addsside effects { field BookingFee affects field TotalPrice; field CurrencyCode affects field TotalPrice; }to the travel,use side effects;to its projection, and a value help onCurrencyCode(I_Currency, a standard view of SAP and of Open RAP Runtime, D44). The reference fixture itself is not changed. no agency entity.use side effects;of a projection BDEF is read (BehaviorModel.useSideEffects); without it the$metadataof a projection has noCommon.SideEffects, as on SAP.- The
draftvariant offixtures/variants.json(the BO of the scenarios, on the trial and in the draft tests) addsside effects { field BookingFee affects field TotalPrice; field CurrencyCode affects field TotalPrice; }to the travel,use side effects;to its projection, and a value help onCurrencyCode(I_Currency, a standard view of SAP and of Open RAP Runtime, D44). The reference fixture itself is not changed. - The scenario
value-helpopens the value help of Currency instead of Agency: the fixture has no agency entity.
- Tests:
csdl.test.ts(no side effect withoutuse side effects, the side effect with it, no warning);roundtrip.test.mjs(the draft variant);rap-variant-features.test.ts(its variant saysuse side effects).
D87 — The administrative data of the drafts as on SAP BTP
- Context: the scenarios recorded on the SAP BTP trial (D84, release 2611) replay in
fe-protocol.test.ts; the first difference of most of them is the administrative data of the drafts. On SAP the navigationDraftAdministrativeDataof a draft entity leads to the entity setI_DraftAdministrativeData(typeI_DraftAdministrativeDataType, keysDraftUUIDandDraftEntityType, 17 properties: the users, the dates,DraftAccessType,DraftIsKeptByUser,DraftIsCreatedByMe,DraftIsLastChangedByMe,DraftIsProcessedByMe, the descriptions of the users), and every draft entity hasDraftEntityCreationDateTimeandDraftEntityLastChangeDateTime. Fiori elements selects them (the List Report readsDraftAdministrativeData($select=DraftUUID,InProcessByUser,…,DraftIsCreatedByMe,…)). Open RAP Runtime had an entity setDraftAdministrativeDatawith 6 properties, the tablerapt_draft_adminitself. - Decision:
rapt_draft_admin_vof the table (unchanged):DraftEntityTypethe root entity in upper case,DraftAccessTypeempty,DraftIsKeptByUserfalse,ProcessingStartDateTimethe creation of the draft,EnqueueStartDateTimeits last change, the descriptions the full names ofrapt_bususerwhen the project has the table (D63), empty otherwise. of the request: a field of the model may becurrentUserIna column, read ascolumn = <user>in$select,$expand,$filterand$orderby(not stored). (timestampl, the columns of the draft table that the runtime already kept;nullfor an active instance in the_allview), hidden in the UI. are unchanged. (Prefer,Preference-Applied,Location, 201 forEdit) or"D89"(advertised actions,__CreateByAssociationControl).core.autocrlf), writes the fixture as a POSIX path inexpected.json, warns when a name is cut before the suffix (16 characters for a table:ZRT_D_BOOKINGwithCRG1), and its step 4 records the cases toresults/casesof the repository for the trial.- The entity set is
I_DraftAdministrativeData, its properties those of SAP, on the viewrapt_draft_admin_vof the table (unchanged):DraftEntityTypethe root entity in upper case,DraftAccessTypeempty,DraftIsKeptByUserfalse,ProcessingStartDateTimethe creation of the draft,EnqueueStartDateTimeits last change, the descriptions the full names ofrapt_bususerwhen the project has the table (D63), empty otherwise. DraftIsCreatedByMe,DraftIsLastChangedByMeandDraftIsProcessedByMedepend on the user of the request: a field of the model may becurrentUserIna column, read ascolumn = <user>in$select,$expand,$filterand$orderby(not stored).- The draft entities have
DraftEntityCreationDateTimeandDraftEntityLastChangeDateTime(timestampl, the columns of the draft table that the runtime already kept;nullfor an active instance in the_allview), hidden in the UI. - The navigation keeps its name
DraftAdministrativeData; the UI andSiblingEntity(D81) are unchanged. - With D87 the recorded scenario
list-reportpasses; the others are marked"fails": "D88"(Prefer,Preference-Applied,Location, 201 forEdit) or"D89"(advertised actions,__CreateByAssociationControl). - The round trip (D84) reads a working copy with CRLF line endings as LF (an older checkout with
core.autocrlf), writes the fixture as a POSIX path inexpected.json, warns when a name is cut before the suffix (16 characters for a table:ZRT_D_BOOKINGwithCRG1), and its step 4 records the cases toresults/casesof the repository for the trial.
- The entity set is
- Tests:
draft.test.ts(the entity set, its properties, the…ByMebooleans for two users, in$expandand$filter, the dates on a draft andnullon an active instance);fe-protocol.test.ts(trial-list-report-har.jsonpasses);roundtrip.test.mjs(CRLF, the POSIX path,--outin step 4, a cut name).
D88 — The answers of the requests as on SAP BTP: preferences, ETag, Location
- Context: the scenarios recorded on the SAP BTP trial (D84) give the status and the headers of each answer of SAP. After D87 their first differences were there: a
PATCHwithPrefer: return=minimalanswers204withPreference-Applied: return=minimaland the newETag; an action called withPrefer: handling=strict(every action of SAP Fiori elements) answersPreference-Applied: handling=strict;EditandActivateanswer201 Createdwith theLocationof the draft or of the active instance;Prepareanswers204, its messages insap-messages. Open RAP Runtime answered200to the three actions, noPreference-Applied, noETagon a204. - Decision: returned,
handling=strictwhen it was asked (D88 does not refuse an action on a warning: the412of strict handling is a gap). joins a collaborative draft);Activateanswers201and theLocationof the active instance;Prepareanswers204.Resume,DiscardandShareare unchanged (Discard204as recorded;ResumeandSharewere not recorded). the recordings:201forEditandActivate,204forPrepare.validation-error,side-effectsandvalue-helpwait for D89 (advertised actions,__CreateByAssociationControl).Preference-Appliednames the preferences applied:return=minimalwhen the entity is not returned,handling=strictwhen it was asked (D88 does not refuse an action on a warning: the412of strict handling is a gap).- A
204ofreturn=minimalcarries theETagof the instance, read after the commit. Editanswers201and theLocationof the draft (also when the user resumes the draft or joins a collaborative draft);Activateanswers201and theLocationof the active instance;Prepareanswers204.Resume,DiscardandShareare unchanged (Discard204as recorded;ResumeandSharewere not recorded).- The cases written by hand in D79 (
draft-list-report.json,draft-object-page.json) follow the recordings:201forEditandActivate,204forPrepare. - With D88 the recorded scenarios
edit,discardandactionpass;create,child,validation-error,side-effectsandvalue-helpwait for D89 (advertised actions,__CreateByAssociationControl).
- Tests:
draft.test.ts(Edit and Activate201with theirLocation,Preference-Applied, theETagof a204, no preference applied withoutPrefer, Prepare204);fe-protocol.test.ts(the recorded scenarios); the status ofEditandActivateindraft-collaborative.test.tsandcds-expressions.test.ts.
D89 — The controls of the instances as on SAP BTP: creation by association, Edit, advertised actions
- Context: after D88 the recorded scenarios
create,child,validation-error,side-effectsandvalue-help(D84) still differed from SAP BTP: SAP reads$select=__CreateByAssociationControl/_Bookingbefore it offers the creation of bookings, and answers the creation of a draft with the actions advertised,#<namespace>.acceptTravel: {}and so on. Its$metadata(2611) has a property__CreateByAssociationControlof the complex type<Entity>CbAControl(one boolean per composition), theInsertRestrictionsof the navigation on__CreateByAssociationControl/_Booking, andEditin__OperationControlwithCore.OperationAvailable. Open RAP Runtime put the compositions in__OperationControland had noEditthere. - Decision: go to
__CreateByAssociationControl(ODataEntityType.createByAssociationControl), no longer to__OperationControl; in a draft they aretrue. authorization):__OperationControl/Edit,Core.OperationAvailable, computed as the update of the active instance;falseon a draft."#<namespace>.<action>": {}, as SAP does (alsoEditon a draft, as recorded). (scripts/fe-har-to-cases.mjs, the runner replaces the placeholder in the names). without draft (on SAP every entity type of a UI service has it) stays a gap (D81).- The compositions whose creation is under instance feature control or authorization (D36) go to
__CreateByAssociationControl(ODataEntityType.createByAssociationControl), no longer to__OperationControl; in a draft they aretrue. Editof a draft root is under operation control when the update is (instance features or authorization):__OperationControl/Edit,Core.OperationAvailable, computed as the update of the active instance;falseon a draft.- A full representation (no
$select) advertises each action under operation control,"#<namespace>.<action>": {}, as SAP does (alsoEditon a draft, as recorded). - The case files name the namespace of an advertised action
#{{NS}}.<action>(scripts/fe-har-to-cases.mjs, the runner replaces the placeholder in the names). - With D89 the nine scenarios recorded on the trial pass.
SAP__Messageson the entity types without draft (on SAP every entity type of a UI service has it) stays a gap (D81).
- The compositions whose creation is under instance feature control or authorization (D36) go to
- Tests:
draft.test.ts(Editand_Bookingcontrolled, the actions advertised on a new draft);odata-write.test.ts(__CreateByAssociationControl, advertised in a full representation only);rap-authorizations.test.ts;csdl.test.ts(snapshot);fe-har.test.mjs(#{{NS}}.Edit);fe-protocol.test.ts(the nine recorded scenarios).
D90 — The $metadata compared with the one of SAP BTP
- Context: the round trip (D84) brought back the
$metadataSAP BTP generated for the draft fixture (conformance/btp/2611/metadata.xml). Read by hand, it showed differences the recorded scenarios of SAP Fiori elements do not exercise (qualifiers of the side effects, value help service,OnDelete, labels of the data elements…). The plan (provisional D99, part b) asks forrapt conformance compare, so that each difference is listed, and its fix measured. - Decision: generates the
$metadataof the project and compares it with the one of SAP BTP. Both are turned into facts: the key, properties (type,Nullable,MaxLength,Precision,Scale), navigations (Partner,OnDelete, constraints), complex types, actions and functions (binding, parameters, return type), entity sets and their bindings, and one fact per annotation (target, term, qualifier: the canonical text of its value), inline or in anAnnotationsblock.CommonareCommon), the schema of the serviceself(namespace or alias), the entity containerself.Container, and the suffix of a renamed copy (D83) removed from the names on both sides (the project may be the fixture or the renamed copy). The type of a record that is the type of its term (Capabilities.InsertRestrictionsType) is optional and SAP leaves it out: it is ignored; a derived type (UI.DataFieldForAction) is kept. The order of the property values of a record does not matter, the order of a collection does. and different, for the structure and the annotations, then lists the differences per target. It is a measure: the command always succeeds. andtrial) against the trial 2611, kept up to date byconformance.test.ts(toMatchFileSnapshot): a change that removes a difference updates it withvitest -u. First measure: 237 facts the same, 209 differences. Step 5 of the README of the round trip runs the comparison. the order of their effect on SAP Fiori elements.rapt conformance compare <src> --sap <metadata.xml> [--suffix XYZ] [--out file] [--json]generates the$metadataof the project and compares it with the one of SAP BTP. Both are turned into facts: the key, properties (type,Nullable,MaxLength,Precision,Scale), navigations (Partner,OnDelete, constraints), complex types, actions and functions (binding, parameters, return type), entity sets and their bindings, and one fact per annotation (target, term, qualifier: the canonical text of its value), inline or in anAnnotationsblock.- Names are normalized: a vocabulary by its short name whatever its alias (
SAP__commonandCommonareCommon), the schema of the serviceself(namespace or alias), the entity containerself.Container, and the suffix of a renamed copy (D83) removed from the names on both sides (the project may be the fixture or the renamed copy). The type of a record that is the type of its term (Capabilities.InsertRestrictionsType) is optional and SAP leaves it out: it is ignored; a derived type (UI.DataFieldForAction) is kept. The order of the property values of a record does not matter, the order of a collection does. - The report (Markdown) counts the facts the same, only on SAP BTP, only in Open RAP Runtime, and different, for the structure and the annotations, then lists the differences per target. It is a measure: the command always succeeds.
conformance/btp/2611/metadata-diff.mdis the report of the draft fixture (variantsdraftandtrial) against the trial 2611, kept up to date byconformance.test.ts(toMatchFileSnapshot): a change that removes a difference updates it withvitest -u. First measure: 237 facts the same, 209 differences. Step 5 of the README of the round trip runs the comparison.- D90 changes no output of Open RAP Runtime: the differences are fixed by later decisions, in the order of their effect on SAP Fiori elements.
- Tests:
conformance.test.ts(normalization: aliases, namespace, container, suffix, record type; the report of the trial 2611;rapt conformance compare --json, refused without--sap).
D91 — Sources SAP BTP must refuse: fixtures/negative, system fields, function modules
- Context: the plan (provisional D99) asks for sources that SAP must refuse, so that the
standardmode refuses what SAP BTP refuses. Trying candidates onrapt checkshowed that Open RAP Runtime accepted two sources ABAP for Cloud Development refuses:sy-subrc = 0.(refused by the trial 2611 withOnly reads can be performed on the field "SY-SUBRC" in the current ABAP language version., D85) andCALL FUNCTION(no function module of the project, and almost none released on SAP BTP). abaplint, configured for the Cloud version, accepts both. - Decision: with exact text replacements and a prefix of its own (
ZRNA…ZRNK), so that one pull on the trial tries them all independently.controlhas no change and must activate. Each case gives the diagnostic ofrapt check(expect.code), the outcome on SAP BTP (sap,nulluntil the trial is tried) and, when unsure, what the trial must settle (confirm). trial, each prefix followed by the suffix of the user (3 characters at most: the table names have 16), withexpected.jsonand the steps. = …,CLEAR sy-xxx), with the message of SAP BTP;CALL FUNCTION, whatever the function module (the released ones are not known before D94). (missing-handler,database-write-in-handler), one accepted by Open RAP Runtime may be refused by SAP (commit-in-handler`): the trial decides, and Open RAP Runtime follows SAP.fixtures/negative/cases.json: one case per source, each the business object ofrapt newwith exact text replacements and a prefix of its own (ZRNA…ZRNK), so that one pull on the trial tries them all independently.controlhas no change and must activate. Each case gives the diagnostic ofrapt check(expect.code), the outcome on SAP BTP (sap,nulluntil the trial is tried) and, when unsure, what the trial must settle (confirm).node scripts/btp-roundtrip.mjs --negative --suffix XYZ --out <dir>writes the cases for the trial, each prefix followed by the suffix of the user (3 characters at most: the table names have 16), withexpected.jsonand the steps.- ABP012 (error), in the rewriting pass of the behavior pools: a system field written (
sy-xxx = …,CLEAR sy-xxx), with the message of SAP BTP;CALL FUNCTION, whatever the function module (the released ones are not known before D94). - Two cases are refused by Open RAP Runtime but may be accepted at activation by SAP (
missing-handler,database-write-in-handler), one accepted by Open RAP Runtime may be refused by SAP (commit-in-handler): the trial decides, and Open RAP Runtime follows SAP.
- Tests:
negative.test.mjs(each case and its diagnostic, the repository for the trial).
D92 — The $metadata closer to the one of SAP BTP
- Context: the first comparison with the trial 2611 (D90) gave 237 facts the same and 209 differences. Many are cheap to remove and follow what SAP BTP generates for the same sources.
- Decision, each as in the
$metadataof SAP BTP: not nullable (Nullable="false", its initial value), exceptDraftUUIDof an active instance;PreserveChangesofEditis not nullable;PrepareandResumehave no return type (Resumenow answers204, asPreparesince D88).__CreateByAssociationControl):Core.Computed,UI.HiddenFilter,UI.Hidden. A composition navigation:Common.Composition.DraftEntityCreationDateTime,DraftEntityLastChangeDateTime:UI.HiddenFilter(from@Consumption.filter.hidden, now read for every field); labelsIs active,Has active. of its root (instead of aPreparationAction). targets of several side effects of the same field merged), instead of<field><n>. (<namespace>.acceptTravel(<namespace>.TravelType)) andInvocationGroupingIsolatedunless the source says otherwise.UI.PresentationVariantno longer addsVisualizations.@Semantics.user.*and@Semantics.systemDateTime.*of its fields (or of its base).Draft (Technical ID)), every element hidden but the users and the dates, the users withCommon.Textto their descriptions. remaining differences are listed in KNOWN_GAPS.md.- Structure: a composition navigation has
<OnDelete Action="Cascade"/>; a UUID property is not nullable (Nullable="false", its initial value), exceptDraftUUIDof an active instance;PreserveChangesofEditis not nullable;PrepareandResumehave no return type (Resumenow answers204, asPreparesince D88). - The controls of the instances (
__EntityControl,__OperationControl,__CreateByAssociationControl):Core.Computed,UI.HiddenFilter,UI.Hidden. A composition navigation:Common.Composition. - The draft fields
IsActiveEntity,HasActiveEntity,HasDraftEntity,DraftEntityCreationDateTime,DraftEntityLastChangeDateTime:UI.HiddenFilter(from@Consumption.filter.hidden, now read for every field); labelsIs active,Has active. - A draft node:
Common.DraftNodewithout record andCommon.DraftActivationViathe entity set of its root (instead of aPreparationAction). - The side effects of a field: qualified
SAP__Field_<field>, one per source field (the targets of several side effects of the same field merged), instead of<field><n>. UI.DataFieldForAction: the action named with its binding parameter (<namespace>.acceptTravel(<namespace>.TravelType)) andInvocationGroupingIsolatedunless the source says otherwise.UI.PresentationVariantno longer addsVisualizations.Common.CreatedBy,CreatedAt,ChangedBy,ChangedAton the entity type, from@Semantics.user.*and@Semantics.systemDateTime.*of its fields (or of its base).I_DraftAdministrativeData: labels of SAP (Draft Administration Data,Draft Entity ID,Draft (Technical ID)), every element hidden but the users and the dates, the users withCommon.Textto their descriptions.- After D92: 298 facts the same, 145 different (
conformance/btp/2611/metadata-diff.md); the remaining differences are listed in KNOWN_GAPS.md.
- Structure: a composition navigation has
- Tests:
conformance.test.ts(the report of the trial 2611);csdl.test.ts(the entity annotations, the action with its binding, noVisualizations,SAP__Field_BookingFee; snapshot);rap-variant-features.test.ts.
D93 — The identifiers of the interfaces of SAP are kept
- Context: to behave as SAP BTP, the generated services use names that start with
SAPorsap: the propertySAP__Messages(D81), the qualifiersSAP__Field_<field>of the side effects (D92), the aliasesSAP__self, the headersap-messages, the parametersap-client, the paths/sap/opu/odata4/…, the namespacescom.sap.vocabularies.*andcom.sap.gateway.srvd.*. The question was whether neutral names should replace them, since the project takes nothing proprietary from SAP (AGENTS.md, rule 2). - Decision: they are kept. the libraries the project uses (SAPUI5,
sap.fe, CAP…), none of which is taken.Common.SideEffects) are published by SAP under the Apache-2.0 license; the OData vocabularies of OASIS too.sap-messages; SAP Fiori elements understands only the namespacescom.sap.vocabularies.*; the requests SAP Fiori elements sends to SAP BTP (the cases recorded on the trial, D83) selectSAP__Messagesby name. Renaming only the others (a qualifier, an alias) would not change the picture and would add differences with SAP BTP. project does not present itself as a product of SAP.- They are identifiers of interfaces, not software of SAP: rule 2 and LICENSES.md are about the libraries the project uses (SAPUI5,
sap.fe, CAP…), none of which is taken. - The vocabularies of SAP (
Common,UI,Communication…, withCommon.MessagesandCommon.SideEffects) are published by SAP under the Apache-2.0 license; the OData vocabularies of OASIS too. - Several cannot change without breaking the clients: OpenUI5 reads the header
sap-messages; SAP Fiori elements understands only the namespacescom.sap.vocabularies.*; the requests SAP Fiori elements sends to SAP BTP (the cases recorded on the trial, D83) selectSAP__Messagesby name. Renaming only the others (a qualifier, an alias) would not change the picture and would add differences with SAP BTP. - The name SAP appears only to designate the system the services are compatible with; the project does not present itself as a product of SAP.
- They are identifiers of interfaces, not software of SAP: rule 2 and LICENSES.md are about the libraries the project uses (SAPUI5,
- Tests: none (no change of behavior).
D94 — State messages on every entity of a business object; the capabilities of SAP BTP
- Context: on SAP BTP,
SAP__Messagesis a property of the entity types of the business objects of a UI service (TravelType,BookingType; notI_DraftAdministrativeDataType), and the entity sets carry capabilities Open RAP Runtime did not write (D90:FilterRestrictions,SortRestrictions,DeepUpdateSupport, details ofUpdateRestrictions, ofSearchRestrictionsand ofNavigationRestrictions). - Decision: entity) has
SAP__MessagesandCommon.Messagesin a service with a UI; without draft the property is an empty collection (no state message is stored outside a draft, D81).UpdateRestrictionswithDeltaUpdateSupported, theNonUpdatableNavigationProperties(every navigation, those of the draft first) andQueryOptions/SelectSupported;DeepUpdateSupport/ContentIDSupportedon an updatable set;SearchRestrictionsof a searchable set withUnsupportedExpressions(AND,NOT, groups: the terms of$searchare all required) and theSearchSyntaxof SAP;FilterRestrictionswithFilterable, the controls of the instances inNonFilterablePropertiesand the dates of a draft (DraftEntity*DateTime,CreationDateTimeandLastChangeDateTimeof the administrative data) filtered by a single interval;SortRestrictionswith the controls inNonSortableProperties;ReadRestrictions/Readablefalse onI_DraftAdministrativeData(read through the navigation of an instance; the entity set itself stays readable). parent (not insertable, no deep update) andSiblingEntity(no deep update, not insertable on the root), the navigations of the draft first; its records have noType.- Every entity type of a business object (an exposed entity with a behavior, or a draft entity) has
SAP__MessagesandCommon.Messagesin a service with a UI; without draft the property is an empty collection (no state message is stored outside a draft, D81). - Entity sets, as on SAP BTP: no
InsertRestrictionswhen insertable (the default);UpdateRestrictionswithDeltaUpdateSupported, theNonUpdatableNavigationProperties(every navigation, those of the draft first) andQueryOptions/SelectSupported;DeepUpdateSupport/ContentIDSupportedon an updatable set;SearchRestrictionsof a searchable set withUnsupportedExpressions(AND,NOT, groups: the terms of$searchare all required) and theSearchSyntaxof SAP;FilterRestrictionswithFilterable, the controls of the instances inNonFilterablePropertiesand the dates of a draft (DraftEntity*DateTime,CreationDateTimeandLastChangeDateTimeof the administrative data) filtered by a single interval;SortRestrictionswith the controls inNonSortableProperties;ReadRestrictions/Readablefalse onI_DraftAdministrativeData(read through the navigation of an instance; the entity set itself stays readable). NavigationRestrictionslists the compositions (insertable or not), the association to the parent (not insertable, no deep update) andSiblingEntity(no deep update, not insertable on the root), the navigations of the draft first; its records have noType.- After D94: 312 facts the same, 129 different with the trial 2611.
- Every entity type of a business object (an exposed entity with a behavior, or a draft entity) has
- Tests:
conformance.test.ts(the report of the trial 2611);csdl.test.ts(SAP__Messageson an entity without draft; snapshot);odata-write.test.ts(SAP__Messagesempty without draft).
D95 — JSON batch, single properties and $value
- Context: KNOWN_GAPS listed the JSON batch of OData 4.01 and
$valueas answered 400 or 501 (phase 1 of the roadmap, provisional D83). SAP BTP declares on its entity container that it accepts both batch formats (Capabilities.BatchSupport) and the functions of$filter(Capabilities.FilterFunctions). - Decision: request has an
id, amethod, aurl, optionalheadersandbody; the requests of anatomicityGroup(next to each other, 400 otherwise) form a change set, one LUW (D23); the id of a request is its Content-ID, referenced as$<id>(letters, digits,_.~-) by the later requests, in a group or not. The answer is{ "responses": [...] }(OData-Version: 4.01):id,atomicityGroup,status,headers,body(JSON when the content is JSON); a failed group answers each of its requests with its error.dependsOnandifare not read: the requests run in order.…/Description/$value: its raw value astext/plain(a decimal with its scale);204for a null value.$valueelsewhere: 400 (no media entity).multipart/mixed) andCapabilities.FilterFunctions(the list of SAP BTP, all supported).POST $batchwithContent-Type: application/jsonreads{ "requests": [...] }: each request has anid, amethod, aurl, optionalheadersandbody; the requests of anatomicityGroup(next to each other, 400 otherwise) form a change set, one LUW (D23); the id of a request is its Content-ID, referenced as$<id>(letters, digits,_.~-) by the later requests, in a group or not. The answer is{ "responses": [...] }(OData-Version: 4.01):id,atomicityGroup,status,headers,body(JSON when the content is JSON); a failed group answers each of its requests with its error.dependsOnandifare not read: the requests run in order.GET Travel(…)/Description: the value of a property,{ "@odata.context": …, "value": … };…/Description/$value: its raw value astext/plain(a decimal with its scale);204for a null value.$valueelsewhere: 400 (no media entity).- The entity container carries
Capabilities.BatchSupport(application/json,multipart/mixed) andCapabilities.FilterFunctions(the list of SAP BTP, all supported).
- Tests:
odata-write.test.ts(JSON batch: atomicity group,$idreference, a read, a failed group, a group split; a property, raw values of a string, a decimal, a navigation);conformance.test.ts.
D96 — The value help of the users of the drafts
- Context: on SAP BTP,
CreatedByUserandLastChangedByUserofI_DraftAdministrativeDatahave a value help (I_DraftAdministrativeUserVH, through a value help service, D90). Open RAP Runtime had none. - Decision: a draft service exposes
I_DraftAdministrativeUserVH(UserID, key, with its textUserDescription), a view of the runtime (rapt_draft_user_vh) over the users of the drafts (creators, last changers, users in process), named withrapt_bususerwhen the project has it (D63).CreatedByUserandLastChangedByUserof the administrative data have it as value help, inline (Common.ValueList) as every value help of Open RAP Runtime (D44), not through a value help service. - Tests:
draft.test.ts(the user of a draft in the value help, itsCommon.ValueList).
D97 — minchar, and the number range intervals as on SAP
- Context: KNOWN_GAPS listed
cl_abap_char_utilities=>mincharas missing, and a number range interval thatrapt/number-ranges.jsondoes not configure was created on the firstnumber_get, where SAP BTP raisescx_nr_object_not_found(D40). - Decision: raises
cx_nr_object_not_found("… not found (configure it in rapt/number-ranges.json)"); theenhancedmode (D45) keeps creating it from 1, a convenience of development.cl_abap_char_utilities=>mincharis the null character (U+0000), below every other one.- In
standardmodecl_numberrange_runtime=>number_geton an interval that is not configured raisescx_nr_object_not_found("… not found (configure it in rapt/number-ranges.json)"); theenhancedmode (D45) keeps creating it from 1, a convenience of development.
- Tests:
utilities.test.ts(the self-test checksminchar;cx_nr_object_not_foundwithout configuration).
D98 — Counts of the tiles read again; mandatory fields marked while editing
- Context: two gaps of KNOWN_GAPS: the counts of the dynamic tiles of the launchpad were read on load only (D37), and a mandatory field left empty was only reported by the save (D45).
- Decision: without a count): the count is read again at that interval while the launchpad is visible, as the refresh interval of the dynamic tiles of SAP. Every count is also read again when the launchpad is shown again (
visibilitychange). orCommon.FieldControl) left empty when it is left: value stateError, "Fill in this field"; the mark goes when a value is entered. The service still checks on save (enhanced mode, D45).- A tile with a
countmay haverefresh, in seconds (at least 10, LPD006 otherwise or without a count): the count is read again at that interval while the launchpad is visible, as the refresh interval of the dynamic tiles of SAP. Every count is also read again when the launchpad is shown again (visibilitychange). - In edit mode, the Object Page marks a mandatory field (
required, fromfield ( mandatory )orCommon.FieldControl) left empty when it is left: value stateError, "Fill in this field"; the mark goes when a value is entered. The service still checks on save (enhanced mode, D45).
- A tile with a
- Tests:
launchpad.test.ts(refresh, LPD006);launchpad-ui.test.ts(counts read again when the launchpad is shown again);ui.test.ts(a mandatory field emptied, then filled).
D99 — Round 2 on the SAP BTP trial: observed values, the strict variant
- Context: several behaviors of SAP BTP cannot be guessed from the documentation nor from the first round (D84 to D86): what an action with a warning answers to
Prefer: handling=strict, the value ofDraftEntityType, whether a disabled action is advertised,SAP__Messageson the entities of a service without draft, and three negative cases (D91). The case files of the recordings keep the structure of the responses only (D79, D83), so they cannot answer the questions about values. - Decision:
Name*for a prefix,error,sap-messages), the values of those properties in anobservedmember of the expectation, read by people and not compared by the runner. The users and their names (…User,…UserDescription) become{{user}}, the UUIDs{{uuid}}, the namespace{{NS}}.scripts/fe-har-to-cases.mjs --observe a,b. administrative data;createandaction: the advertised actions and the controls) and the variants they need; a new scenariostrict-handlingplays an action that reports a warning. of the session (draft service withstrict, recordings,$metadataof the draft service and of a service without draft, negative cases). creates a draft needs%is_draftin the derived types of EML (complete EML, phase 4).responseShapeofscripts/lib/fe-har.mjskeeps, when asked (observe: property names,Name*for a prefix,error,sap-messages), the values of those properties in anobservedmember of the expectation, read by people and not compared by the runner. The users and their names (…User,…UserDescription) become{{user}}, the UUIDs{{uuid}}, the namespace{{NS}}.scripts/fe-har-to-cases.mjs --observe a,b.- The scenarios of
scripts/lib/fe-scenarios.mjsname what they observe (list-report: the administrative data;createandaction: the advertised actions and the controls) and the variants they need; a new scenariostrict-handlingplays an action that reports a warning. fixtures/variants.json: variantstrict,acceptTravelreports its message as a warning.conformance/btp/round-2.md: the questions, what Open RAP Runtime does today, and the steps of the session (draft service withstrict, recordings,$metadataof the draft service and of a service without draft, negative cases).- Static and factory actions on a draft instance stay answered 501: a factory action that creates a draft needs
%is_draftin the derived types of EML (complete EML, phase 4).
- Tests:
fe-har.test.mjs(observed values without user nor key,error,sap-messages);fe-record.test.mjs(the variants of the scenarios exist);roundtrip.test.mjs(thestrictvariant applies).
D100 — Elements of to-one associations in the select list
- Context:
_Travel.TravelID as TravelNumberin a view entity, or_Agency.Namein a projection, is among the most frequent constructs of RAP projections; Open RAP Runtime refused every path (CDS002). Phase 4 of the roadmap (provisional D86) starts with it. - Decision: entity (its own associations) or a projection (the associations of the projected entity), alone or inside an expression (D67). It is typed by the element it reaches and keeps its label; like a calculated element it is read-only (
Core.Computed) and ignored in the bodies. element }; the PostgreSQL view computes it with nested correlated subqueries on the views of the targets ((SELECT p0_0."TravelID" FROM "zrt_r_travel" p0_0 WHERE p0_0."TravelUUID" = "TravelUUID" LIMIT 1)), so it is filtered and sorted like any element andNULLwithout a target; the views read by a path are created first. In the_allview of a draft, the path starts from the values of the draft and reads the active instances of its targets. CDS004. Filters in a path (_X[ … ]`) are not parsed yet.- A path of to-one associations ending with an element is an element of the entity, in a view entity (its own associations) or a projection (the associations of the projected entity), alone or inside an expression (D67). It is typed by the element it reaches and keeps its label; like a calculated element it is read-only (
Core.Computed) and ignored in the bodies. - The model holds it as an expression
{ kind: "path", from: "self" | "source", associations, element }; the PostgreSQL view computes it with nested correlated subqueries on the views of the targets ((SELECT p0_0."TravelID" FROM "zrt_r_travel" p0_0 WHERE p0_0."TravelUUID" = "TravelUUID" LIMIT 1)), so it is filtered and sorted like any element andNULLwithout a target; the views read by a path are created first. In the_allview of a draft, the path starts from the values of the draft and reads the active instances of its targets. - A to-many association in a path (no single value), an unknown association or element: CDS002, CDS004. Filters in a path (
_X[ … ]) are not parsed yet.
- A path of to-one associations ending with an element is an element of the entity, in a view entity (its own associations) or a projection (the associations of the projected entity), alone or inside an expression (D67). It is typed by the element it reaches and keeps its label; like a calculated element it is read-only (
- Tests:
ir.test.ts(type and expression of a path, CDS004, to-many refused);cds-paths.test.ts(a view entity, an expression and a projection;$filter; a draft; a body ignoring it; the label andCore.Computed).
D101 — The WHERE condition of view entities
- Context: a view entity with a WHERE clause was compiled without it (warning CDS002): its view returned rows SAP does not return.
- Decision: D67); the IR resolves it with the names of the select list: the columns of the source,
$projectionelements, to-one association paths (D100).EntityModel.whereholds it. the ABAP SQL of the behavior pools (D26) and of the projections read it. it to the values of the draft: a draft instance is read through the same views as an active one. CDS002, an error (no longer a warning: the rows would differ from SAP).- The CDS parser keeps the condition of the WHERE clause (the condition grammar of CASE WHEN, D67); the IR resolves it with the names of the select list: the columns of the source,
$projectionelements, to-one association paths (D100).EntityModel.whereholds it. - The PostgreSQL view of the entity has the condition (
WHERE …on its source); the views of the ABAP SQL of the behavior pools (D26) and of the projections read it. - The draft part of the
_allview applies the conditions of the entity and of the views below it to the values of the draft: a draft instance is read through the same views as an active one. - What the condition grammar does not parse (
BETWEEN,IN) and a WHERE in a projection: CDS002, an error (no longer a warning: the rows would differ from SAP).
- The CDS parser keeps the condition of the WHERE clause (the condition grammar of CASE WHEN, D67); the IR resolves it with the names of the select list: the columns of the source,
- Tests:
ir.test.ts(the condition resolved; CDS004 on an unknown name);cds-where.test.ts(a travel excluded, read by key: 404; bookings filtered on an element and through_Travel).
D102 — BETWEEN, IS INITIAL and the WHERE of projections
- Context: D101 left
BETWEENand the WHERE of projections out. The ABAP keyword documentation of ABAP Cloud (cds_condof CDS view entities) lists the relational expressions of a condition: comparisons,BETWEEN,LIKE,IS NULL,IS INITIAL; there is noINlist (abaplint does not parse it either). A projection view may have a WHERE condition on the elements of its projected entity. - Decision: condition and in
CASE WHEN. character types,0for the numbers,'0…0'for NUMC,FALSEfor booleans,NULLfor the types stored NULL when initial (dates, times, time stamps, UUIDs, D8). its to-one associations; the view of the projection and the draft part of the_allview apply it (D101). Before, it was silently ignored.x [NOT] BETWEEN a AND bis parsed asx >= a AND x <= b(negated with NOT), in a WHERE condition and inCASE WHEN.x IS [NOT] INITIALcompares with the initial value of the type ofx:''for the character types,0for the numbers,'0…0'for NUMC,FALSEfor booleans,NULLfor the types stored NULL when initial (dates, times, time stamps, UUIDs, D8).- The WHERE of a projection is parsed and resolved on the elements of the projected entity and its to-one associations; the view of the projection and the draft part of the
_allview apply it (D101). Before, it was silently ignored. IN ( … )stays refused (CDS001, the source cannot be parsed), as on SAP.
- Tests:
ir.test.ts(BETWEEN, IS INITIAL, IN refused);cds-where.test.ts(a projection with BETWEEN and IS NOT INITIAL on top of a filtered view entity).
D103 — $session.user, system_language and client
- Context: the PostgreSQL views of the CDS entities are shared by every request, so only
$session.system_datewas supported (D67);$session.useris common in RAP views (the instances of the user, a "created by me" flag). - Decision: (
clnt) are expressions of the select list and of the WHERE conditions (D101). true); the client is'100'(one client, D9). In a CDS view entity the client handling is implicit (SAP filters with$session.client): no client field is exposed (D9), but$session.clientstays an operand.sy-mandtof the ABAP code is100too (the runtime of abaplint set123), so that both agree. time zone of Open RAP Runtime, D40, alsosy-zonlo),user_datethe system date (sy-datlo,sy-timloset likesy-datum,sy-uzeit). The application session variables ($session.bs_…) stay CDS002. ABAP language ofAccept-Language, assy-langu) on its transaction, so that the ABAP SQL of the behavior pools reads them. The reads of the OData layer run in a transaction that sets them, only when a view of the model reads$session.userorsystem_language`; otherwise nothing changes.$session.user(char(12)),$session.system_language(lang) and$session.client(clnt) are expressions of the select list and of the WHERE conditions (D101).- The views read
current_setting('rapt.user', true)andcurrent_setting('rapt.language', true); the client is'100'(one client, D9). In a CDS view entity the client handling is implicit (SAP filters with$session.client): no client field is exposed (D9), but$session.clientstays an operand.sy-mandtof the ABAP code is100too (the runtime of abaplint set123), so that both agree. - The other built-in session variables of CDS view entities:
user_timezoneisUTC(the user time zone of Open RAP Runtime, D40, alsosy-zonlo),user_datethe system date (sy-datlo,sy-timloset likesy-datum,sy-uzeit). The application session variables ($session.bs_…) stay CDS002. - Every LUW sets
rapt.user(the ABAP name of the user) andrapt.language(the one-letter ABAP language ofAccept-Language, assy-langu) on its transaction, so that the ABAP SQL of the behavior pools reads them. The reads of the OData layer run in a transaction that sets them, only when a view of the model reads$session.userorsystem_language; otherwise nothing changes.
- Tests:
ir.test.ts($session.useraccepted, another session variable refused);cds-session.test.ts(the user, the language ofAccept-Language, the client, a flag computed with the user and filtered).
D104 — Joins of view entities
- Context: a view entity with a join was refused (CDS002). Joins are less frequent than associations in RAP, but common in the read-only views of an application.
- Decision:
inner joinandleft outer joinof tables and CDS entities are supported,right outerandcrossjoins stay CDS002 (an unknown joined source: CDS003). is an expression{ kind: "column", source: alias }: read-only like a calculated element, possibly a key element. The ON conditions are resolved like the WHERE (D101). column qualified by its alias; the views of the joined entities are created first. In the draft part of an_allview, a joined column is a correlated subquery on the joined source from the values of the draft (first match).- The CDS parser keeps the joins of the data source (kind, source, alias, ON condition);
inner joinandleft outer joinof tables and CDS entities are supported,right outerandcrossjoins stay CDS002 (an unknown joined source: CDS003). - An element
alias.columnof a joined source, or a column found in a single joined source, is an expression{ kind: "column", source: alias }: read-only like a calculated element, possibly a key element. The ON conditions are resolved like the WHERE (D101). - The PostgreSQL view joins the sources (
FROM primary AS t INNER JOIN … AS b ON …), every column qualified by its alias; the views of the joined entities are created first. In the draft part of an_allview, a joined column is a correlated subquery on the joined source from the values of the draft (first match). - A left outer join without match gives
NULL, read as the initial value, as ABAP SQL does.
- The CDS parser keeps the joins of the data source (kind, source, alias, ON condition);
- Tests:
ir.test.ts(the joins of the model, a column without alias, a key of a joined source, right outer join and unknown source refused);cds-joins.test.ts(inner join of two tables, left outer join of an entity with a condition on it, a filter on a joined column,Core.Computed).
D105 — Aggregate expressions, GROUP BY and HAVING
- Context: aggregate expressions were CDS002. The ABAP keyword documentation of ABAP Cloud (aggregate expressions of CDS view entities) fixes them:
MAX,MIN,SUM,AVG( [DISTINCT] arg AS dtype )(the type is mandatory: DEC, CURR, QUAN, D16N, D34N or FLTP),COUNT( DISTINCT arg )andCOUNT(*)(INT4); no STRING or RAWSTRING operand; an aggregate in the select list needs aGROUP BYthat lists every non-aggregated field;HAVINGfollows aGROUP BY. - Decision: as above (
MAX,MIN,SUM: the type of the operand) and checks the rules with CDS022: an aggregate withoutGROUP BY, a field outside the aggregates not listed inGROUP BY(its columns, also inside a calculated element),AVGwithout type or with another type,COUNTof a value withoutDISTINCT, an aggregate in an aggregate, a string operand.integer(INT4). The aggregated elements are read-only, like calculated elements.- The CDS parser reads the aggregate expressions,
GROUP BYandHAVING; the IR types them as above (MAX,MIN,SUM: the type of the operand) and checks the rules with CDS022: an aggregate withoutGROUP BY, a field outside the aggregates not listed inGROUP BY(its columns, also inside a calculated element),AVGwithout type or with another type,COUNTof a value withoutDISTINCT, an aggregate in an aggregate, a string operand. - The PostgreSQL view groups and filters (
GROUP BY …,HAVING …);COUNTis cast tointeger(INT4). The aggregated elements are read-only, like calculated elements. - Aggregates may appear inside another expression (a CASE, a CAST, a function), as SAP allows.
- The CDS parser reads the aggregate expressions,
- Tests:
ir.test.ts(the rules, with the messages);cds-aggregates.test.ts(COUNT(*), COUNT(DISTINCT), SUM, AVG, MAX per travel and currency, HAVING, Edm types,Core.Computed).
D106 — UNION and UNION ALL of view entities
- Context: a view entity with a union was compiled as its first SELECT only (the other branches were not read). The ABAP keyword documentation of ABAP Cloud (
UNIONof CDS view entities) gives the rules: the same number of elements, the same element names and key elements in each branch, element annotations in the first branch only, the types of the first SELECT and a matrix of compatible types, no STRING or RAWSTRING withoutALL, and the annotation@Metadata.ignorePropagatedAnnotations: truemandatory. - Decision: (source, joins, WHERE, GROUP BY, elements); the IR builds each branch as a view entity and keeps them in
EntityModel.union, the entity being the first branch. character-like types, the same type otherwise, CURR only with CURR of the same decimals) and its warnings are not reported. Associations in a union view: CDS002. cast to the types of the first SELECT; the sources of every branch are created first.- The CDS parser reads each branch (a nested SELECT after
UNION [ALL]) like the first one (source, joins, WHERE, GROUP BY, elements); the IR builds each branch as a view entity and keeps them inEntityModel.union, the entity being the first branch. - The rules above are CDS022 errors; the type matrix is simplified to families (numbers, character-like types, the same type otherwise, CURR only with CURR of the same decimals) and its warnings are not reported. Associations in a union view: CDS002.
- The PostgreSQL view is
SELECT … UNION [ALL] SELECT …, the columns of the other branches cast to the types of the first SELECT; the sources of every branch are created first.
- The CDS parser reads each branch (a nested SELECT after
- Tests:
ir.test.ts(the rules, with their messages);cds-unions.test.ts(UNION ALL of travels and bookings, a filter on it, UNION removing duplicates).
D107 — Parameters of view entities
- Context: views
with parameterswere CDS002. A PostgreSQL view has no parameters, and the views of Open RAP Runtime are shared by every request. - Decision: actual parameters of a data source,
select from View( p: value )(abaplint reads it as a function call when the value is a literal, as a name with parameters otherwise). is an expression of the select list and the conditions, read by the view from the setting of the transactionrapt.p_<view>__<parameter>. An actual parameter is a literal, a parameter or a session variable; an unknown one is CDS004, a missing one without system field CDS022. parameters, non-nullable) whose contained navigationSetgives the results; the results type has the navigationParameters.GET View(p=…)/Set(with$filter,$select…) sets the parameters on the transaction of the read, a system field defaulting to the date, the user, the language or the client of the request; a view reading a parameterized view with the values it gives sets them the same way.VieworView/Setwithout the parameters: 400. Not supported: the ABAP SQL of the behavior pools on a parameterized view. The form of the$metadatafollows the parameterized entity sets of SAP Fiori elements for OData V4 and is to confirm on SAP BTP (round 2, D99).- The CDS parser reads
with parameters name : type(with@Environment.systemField) and the actual parameters of a data source,select from View( p: value )(abaplint reads it as a function call when the value is a literal, as a name with parameters otherwise). - The IR types the parameters (built-in types, data elements; CDS014 otherwise);
$parameters.pis an expression of the select list and the conditions, read by the view from the setting of the transactionrapt.p_<view>__<parameter>. An actual parameter is a literal, a parameter or a session variable; an unknown one is CDS004, a missing one without system field CDS022. - OData: the entity set of a parameterized view is of the type
<Set>Parameters(keys: the parameters, non-nullable) whose contained navigationSetgives the results; the results type has the navigationParameters.GET View(p=…)/Set(with$filter,$select…) sets the parameters on the transaction of the read, a system field defaulting to the date, the user, the language or the client of the request; a view reading a parameterized view with the values it gives sets them the same way.VieworView/Setwithout the parameters: 400. - Not yet (CDS002): a projection of a parameterized view, a join or an association to one. Not supported: the ABAP SQL of the behavior pools on a parameterized view. The form of the
$metadatafollows the parameterized entity sets of SAP Fiori elements for OData V4 and is to confirm on SAP BTP (round 2, D99).
- The CDS parser reads
- Tests:
ir.test.ts(the parameters,$parameters, missing and unknown actual parameters, an unknown type);cds-parameters.test.ts(View(p=…)/Set, a system field from the session or given, 400 without parameters, a view passing a literal, the$metadata).
D108 — CDS hierarchies and the OData recursive hierarchy
- Context:
define hierarchywas CDS002, and a tree table of SAP Fiori elements (RAP treeview, read-only) needs the recursive hierarchy of OData V4 (Aggregation.RecursiveHierarchy,Hierarchy.RecursiveHierarchy, the transformations of$apply). - Decision: child to parent association … [directory … filter by …] [start where …] siblings order by … [depth …] [multiple parents …] [orphans …] [cycles …] )
and its element list (elements of the source,$node.<attribute> as Alias, associations of the source). a self association compared with=only (CDS022, CDS004); START WHERE is implicit (the parent is initial) only when the parent node is numeric; SIBLINGS ORDER BY is mandatory and on no string; DEPTH (a literal or an integer parameter) only with ORPHANS IGNORE; CYCLES BREAKUP only with MULTIPLE PARENTS ALLOWED.$node.hierarchy_rank,hierarchy_tree_size,hierarchy_parent_rank,hierarchy_level,hierarchy_is_cycle,hierarchy_is_orphan,node_id,parent_idare typed as SAP documents them. PERIOD and GENERATE SPANTREE: CDS002; LOAD, CACHE and NODETYPE only tune the database or inform analytical engines: ignored. WHERE; with ORPHANS ROOT, the nodes whose parent is missing, flagged), then the children through the ON condition, each with the sibling ranks from its root ($path): their order is the preorder, which gives the hierarchy attributes. DIRECTORY … FILTER BY filters the source. The exceptions SAP raises — a cycle (CYCLES ERROR, the default), a node with several parents (MULTIPLE PARENTS NOT ALLOWED, the default; LEAVES ONLY for an inner node), an orphan (ORPHANS ERROR) — are raised by the view (rapt_hierarchy_error), cycles first. Every hierarchy of the project is in the model with its source, for the ABAP SQL of the behavior pools. has both annotations of the qualifier of the hierarchy (its name), NodeProperty the node element, ParentNavigationProperty its to-one self association, and the properties LimitedDescendantCount, DistanceFromRoot, DrillState, LimitedRank (computed, hidden), with the vocabularies Aggregation and Hierarchy.@UI.presentationVariantgives RecursiveHierarchyQualifier and InitialExpansionLevel. A hierarchy with parameters, or whose association compares several elements: CDS002; a missing node element or parent association: CDS022.ancestors(…, filter(…)/search(…), [n,] keep start),descendants(…, filter(…), n),orderby(…)(the siblings),Hierarchy.TopLevels(…, Levels=n, ExpandLevels=[…], Show=[…]), then$skip,$top,$count,$select,$expand. It reads the nodes the user may read (access controls, drafts), the preorder of the hierarchy view, and computes the result in preorder; a node whose parent cannot be read is left out with its descendants. DrillState and DistanceFromRoot follow the unlimited hierarchy of the Hierarchy vocabulary (the sub-hierarchy ofdescendants). distance of a node read bydescendants`.- The CDS parser reads
define hierarchy … [with parameters] as parent child hierarchy( source … child to parent association … [directory … filter by …] [start where …] siblings order by … [depth …] [multiple parents …] [orphans …] [cycles …] )and its element list (elements of the source,$node.<attribute> as Alias, associations of the source). - The IR checks it as SAP does: the source is a view entity exposing the hierarchy association, a self association compared with
=only (CDS022, CDS004); START WHERE is implicit (the parent is initial) only when the parent node is numeric; SIBLINGS ORDER BY is mandatory and on no string; DEPTH (a literal or an integer parameter) only with ORPHANS IGNORE; CYCLES BREAKUP only with MULTIPLE PARENTS ALLOWED.$node.hierarchy_rank,hierarchy_tree_size,hierarchy_parent_rank,hierarchy_level,hierarchy_is_cycle,hierarchy_is_orphan,node_id,parent_idare typed as SAP documents them. PERIOD and GENERATE SPANTREE: CDS002; LOAD, CACHE and NODETYPE only tune the database or inform analytical engines: ignored. - SQL: the view of a hierarchy is a recursive query on its source view: the root nodes (START WHERE; with ORPHANS ROOT, the nodes whose parent is missing, flagged), then the children through the ON condition, each with the sibling ranks from its root (
$path): their order is the preorder, which gives the hierarchy attributes. DIRECTORY … FILTER BY filters the source. The exceptions SAP raises — a cycle (CYCLES ERROR, the default), a node with several parents (MULTIPLE PARENTS NOT ALLOWED, the default; LEAVES ONLY for an inner node), an orphan (ORPHANS ERROR) — are raised by the view (rapt_hierarchy_error), cycles first. Every hierarchy of the project is in the model with its source, for the ABAP SQL of the behavior pools. - OData: an exposed entity annotated
@OData.hierarchy.recursiveHierarchy: [{ entity.name: … }]has both annotations of the qualifier of the hierarchy (its name), NodeProperty the node element, ParentNavigationProperty its to-one self association, and the properties LimitedDescendantCount, DistanceFromRoot, DrillState, LimitedRank (computed, hidden), with the vocabularies Aggregation and Hierarchy.@UI.presentationVariantgives RecursiveHierarchyQualifier and InitialExpansionLevel. A hierarchy with parameters, or whose association compares several elements: CDS002; a missing node element or parent association: CDS022. - The runtime serves the requests of the OData V4 model of OpenUI5 for a tree table:
ancestors(…, filter(…)/search(…), [n,] keep start),descendants(…, filter(…), n),orderby(…)(the siblings),Hierarchy.TopLevels(…, Levels=n, ExpandLevels=[…], Show=[…]), then$skip,$top,$count,$select,$expand. It reads the nodes the user may read (access controls, drafts), the preorder of the hierarchy view, and computes the result in preorder; a node whose parent cannot be read is left out with its descendants. DrillState and DistanceFromRoot follow the unlimited hierarchy of the Hierarchy vocabulary (the sub-hierarchy ofdescendants). - To confirm on SAP BTP (round 2, D111): the qualifier, the names of the four properties, the distance of a node read by
descendants.
- The CDS parser reads
- Tests:
ir.test.ts(the checks of SAP);cds-hierarchies.test.ts(preorder and attributes, DEPTH by parameter, siblings descending, CYCLES BREAKUP and ERROR, ORPHANS ROOT and ERROR, multiple parents;$metadata, TopLevels with Levels, ExpandLevels, orderby, paging, descendants, ancestors with filter and search, another qualifier).
D109 — Late numbering
- Context:
late numberingwas BDEF002 andadjust_numbersABP007: a BO whose keys are drawn gaplessly at the end of the transaction (numbers of documents, items) could not run. - Decision: BDEF, which reuses it: BDEF012). As on SAP, the direct children of an entity with late numbering have it too, and it excludes early numbering (BDEF032). The saver class must redefine
adjust_numbers(ABP002), declaredCHANGING mapped TYPE RESPONSE FOR MAPPED LATE reported TYPE RESPONSE FOR REPORTED LATE(andfailedwithcl_abap_behavior_saver_failed); itscleanupis called after the save. MAPPED LATE of such an entity has%pre(%pid, and the preliminary key%tmp) and%key. keys of the next EML statements, and a preliminary key in its initial key fields, which no instance has (negative integers, the highest NUMC values,#-prefixed texts, new UUIDs): the buffer, the locks and the content IDs of a changeset use it. row per created instance (%pid,%tmp) and fills%key; the instances take their final keys, the foreign keys of their children follow; then the managed write andsave_modified. A created instance left without final key is a runtime error, as on SAP. the final keys. table),CONVERT KEY. Different from SAP: during the interaction phase the key fields hold the preliminary values instead of initial ones.- The BDEF accepts
late numbering [in place]on the entities of a managed BO (not in a projection BDEF, which reuses it: BDEF012). As on SAP, the direct children of an entity with late numbering have it too, and it excludes early numbering (BDEF032). The saver class must redefineadjust_numbers(ABP002), declaredCHANGING mapped TYPE RESPONSE FOR MAPPED LATE reported TYPE RESPONSE FOR REPORTED LATE(andfailedwithcl_abap_behavior_saver_failed); itscleanupis called after the save. MAPPED LATE of such an entity has%pre(%pid, and the preliminary key%tmp) and%key. - Interaction phase: a created instance gets a
%pid, returned inmappedand accepted in the keys of the next EML statements, and a preliminary key in its initial key fields, which no instance has (negative integers, the highest NUMC values,#-prefixed texts, new UUIDs): the buffer, the locks and the content IDs of a changeset use it. - Late save phase: after the determinations and validations on save,
adjust_numbersgets one row per created instance (%pid,%tmp) and fills%key; the instances take their final keys, the foreign keys of their children follow; then the managed write andsave_modified. A created instance left without final key is a runtime error, as on SAP. - OData: the response of a create, its
Locationand the parts of a changeset are rendered with the final keys. - Not yet: late numbering in a draft BO (BDEF002; SAP needs the key
DRAFTUUIDin the draft table),CONVERT KEY. Different from SAP: during the interaction phase the key fields hold the preliminary values instead of initial ones.
- The BDEF accepts
- Tests:
ir.test.ts(the model, BDEF032 on a child without late numbering, ABP002 withoutadjust_numbers);rap-late-numbering.test.ts(a deep create numbered byadjust_numbers, theLocation, a new item of an existing order, a changeset with content IDs).
D110 — The draft indicator %is_draft in EML
- Context: the derived types of a draft BO had no
%is_draft: ABAP code of SAP using it (%tkywith the indicator,%is_draft = if_abap_behv=>mk-onin a creation,%is_draft = key-%is_draftin a copy) did not compile, and a factory action on a draft answered 501. - Decision: in the rows of the creations. transaction of a draft (D81), off in a transaction on the active instances. EML reads it back, as SAP: a key without it (off) names the active instance. table from the transaction of a draft. Changing the other image is a runtime error (not yet). (administrative data of the user, the draft tables; the children created by association with it are drafts of it), written by the save;
mappedcarries%is_draft. factory action on a draft instance runs in the transaction of the draft; a root it creates is a draft of its own (its DraftUUID), apart from the draft it was called on. Static actions stay on the collection (G1d). EML in an active transaction (they run on its first change).- The derived types of the entities of a draft BO have
%is_draft(ABP_BEHV_FLAG) in%tkyand in the rows of the creations. - The rows the runtime gives the handlers carry the indicator of their instance: on in the transaction of a draft (D81), off in a transaction on the active instances. EML reads it back, as SAP: a key without it (off) names the active instance.
- A read of the other image goes to it: the draft table from an active transaction, the active table from the transaction of a draft. Changing the other image is a runtime error (not yet).
- A creation with
%is_drafton in a transaction on the active instances creates a new draft (administrative data of the user, the draft tables; the children created by association with it are drafts of it), written by the save;mappedcarries%is_draft. - OData: a factory action answers the draft its handler created (
IsActiveEntityfalse). A factory action on a draft instance runs in the transaction of the draft; a root it creates is a draft of its own (its DraftUUID), apart from the draft it was called on. Static actions stay on the collection (G1d). - Not yet: changing the other image in EML; the determinations on modify of a draft created by EML in an active transaction (they run on its first change).
- The derived types of the entities of a draft BO have
- Tests:
eml-draft.test.ts(a factory action creating a draft from an active instance and from a draft, its administrative data); the draft and variant tests run with the indicator.
D111 — Round 2 on the trial: the CDS of D100 to D110
- Context: the CDS features of D100 to D108 follow the documentation of SAP; their
$metadataand their answers (the recursive hierarchy above all) are to confirm on SAP BTP, like the protocol of D99. - Decision: BETWEEN and IS NOT INITIAL (
ZRT_I_CdsBooking); COUNT, SUM, MAX with GROUP BY and HAVING (ZRT_I_CdsBookingStats); UNION ALL (ZRT_I_CdsDates); a parameter (ZRT_I_CdsTravelByStatus); a table entity, a view with@OData.hierarchy.recursiveHierarchyand its hierarchy (ZRT_CDSNODE,ZRT_I_CdsNode,ZRT_I_CdsNodeHier); a class that fills the nodes on the trial (ZRT_CL_CDS_FILL). The variantcdsadds them (add, a new member of the variants) and exposes them in the service.$metadataand the reads ofscripts/lib/cds-reads.mjson the trial, and writes the answers without user name, key, namespace or suffix. hierarchy: when the answers of the trial are inconformance/btp/<release>/cds/, Open RAP Runtime must give the same rows and count.$session.bs_system_id(CDS002, which SAP documents: to settle). numbering on SAP, and the factory action of the fixture creates an active copy).fixtures/cdsholds views on the tables of the Travel fixture: a join, a path,$session, BETWEEN and IS NOT INITIAL (ZRT_I_CdsBooking); COUNT, SUM, MAX with GROUP BY and HAVING (ZRT_I_CdsBookingStats); UNION ALL (ZRT_I_CdsDates); a parameter (ZRT_I_CdsTravelByStatus); a table entity, a view with@OData.hierarchy.recursiveHierarchyand its hierarchy (ZRT_CDSNODE,ZRT_I_CdsNode,ZRT_I_CdsNodeHier); a class that fills the nodes on the trial (ZRT_CL_CDS_FILL). The variantcdsadds them (add, a new member of the variants) and exposes them in the service.scripts/btp-read-trial.mjsreads, with the session of the browser of the recordings, the$metadataand the reads ofscripts/lib/cds-reads.mjson the trial, and writes the answers without user name, key, namespace or suffix.cds-round2.test.tsbuilds the variant, reads each view, and replays the reads of the hierarchy: when the answers of the trial are inconformance/btp/<release>/cds/, Open RAP Runtime must give the same rows and count.fixtures/negativegets two CDS cases: COUNT(*) without GROUP BY (CDS022) and$session.bs_system_id(CDS002, which SAP documents: to settle).- Late numbering (D109) and
%is_draft(D110) are not in round 2 yet (no draft BO with late numbering on SAP, and the factory action of the fixture creates an active copy).
- Tests:
cds-round2.test.ts,roundtrip.test.mjs(the variantcds),cds-reads.test.mjs(the URLs, the neutral answers),negative.test.mjs(the two cases).
D112 — The command line is @open-rap/cli, a package of the npm organization
- Context:
open-rap-runtime(D65) has no scope: an unscoped package belongs to user accounts, so it appeared on the account of the maintainer, not in the organizationopen-rapthat holds@open-rap/model,@open-rap/compilerand@open-rap/runtime. - Decision:
packages/cliis published as@open-rap/cli(npm install -g @open-rap/cli,npx @open-rap/cli check .); the command staysrapt(D65). The four npm packages are packages of the organization, with the same trusted publisher (D78). Once, by hand: publish@open-rap/clifor the first time (the trusted publisher of a package is declared on its page, so the package must exist), declarerelease.ymlas its trusted publisher, then deprecateopen-rap-runtime(npm deprecate open-rap-runtime "moved to @open-rap/cli") and unpublish it if npm allows it. - Tests:
packages/cli/test(the package and its command); the release workflow installs the packed@open-rap/cliand runsrapt.
D113 — The MCP server as an OAuth 2.0 protected resource
- Context: an MCP client that supports the authorization of the protocol (Claude, VS Code) connects to a server it only knows by its URL: on a
401, it looks for the metadata of the protected resource (RFC 9728), which name the authorization server, then signs the user in there (PKCE, dynamic client registration or a client given by hand)./mcpanswered a bareBearer realm="open-rap-runtime": the client did not know where to sign in, the server could only be used with a token obtained by other means. - Decision: in OIDC mode, the application is the resource server and the identity provider stays the only authorization server (the application never issues tokens): for the clients that do not insert the path) returns, without authentication:
resource(<PUBLIC_URL>mcp),authorization_servers(OIDC_ISSUER),bearer_methods_supported,scopes_supported(OIDC_MCP_SCOPES, when given) andresource_name(the name of the MCP server); resource_metadata="…", witherror="invalid_token"when a token was given and refused,error="insufficient_scope"with a403(required role missing), andscope="…"when the scopes are configured; the audience of the tokens of an MCP client is the resource,OIDC_AUDIENCE=<PUBLIC_URL>mcp`;GET /.well-known/oauth-protected-resource/mcp(and/.well-known/oauth-protected-resourcefor the clients that do not insert the path) returns, without authentication:resource(<PUBLIC_URL>mcp),authorization_servers(OIDC_ISSUER),bearer_methods_supported,scopes_supported(OIDC_MCP_SCOPES, when given) andresource_name(the name of the MCP server);- a refused request gets
WWW-Authenticate: Bearer realm="open-rap-runtime", resource_metadata="…", witherror="invalid_token"when a token was given and refused,error="insufficient_scope"with a403(required role missing), andscope="…"when the scopes are configured; - the token is verified as before (issuer, signature,
OIDC_AUDIENCE,OIDC_REQUIRED_ROLE): the audience of the tokens of an MCP client is the resource,OIDC_AUDIENCE=<PUBLIC_URL>mcp; - in development (
AUTH_MODE=none), nothing changes: no metadata, the development user.
- Why: an agent signed in as a user of the IdP acts with that user's authorizations, access controls and messages, as in the UI; no secret to paste into the agent. The registration of the clients and the consent stay with the IdP (Auth0, Keycloak, Entra ID…), which already does it.
- Tests:
runtime/test/mcp-oauth.test.ts(metadata, challenges, audience, required role, environment).
D114 — Unique ABAP user names
- Context: ABAP knows a user by a name of at most 12 characters:
sy-uname, the administrative fields (abp_creation_user,abp_lastchange_user),aspect userof the access controls, the owner of a draft. The runtime gave the identifier of the identity provider cut to 12 characters in upper case. Two identifiers with the same beginning (jean.dupont@acme.com,jean.dupont@acme-consulting.com:JEAN.DUPONT@) became the same ABAP user, without any message: each one read the documents of the other throughaspect userand passed the checks of the owner in the behavior pool. SAP BTP does not derive the name from the e-mail: a business user gets a user ID of 12 characters (CB9980000123), the e-mail being an alias of the sign-in. - Decision: the client credentials flow) gets its own ABAP name, given at its first request and kept in
rapt_abap_user(idp_id,abap_nameunique), created at the first use like the views of the UI (D51), outside the schema of the business objects; has it; otherwise a generated nameCB+ 10 digits from the sequencerapt_abap_user_seq(fromCB9980000001, the form of the user IDs of SAP BTP); a name, once given, never changes; constraints of the table (ON CONFLICT DO NOTHING, then read again): the first one wins, the others read its name; request; the names are kept in memory per process;- each identifier of the identity provider (
OIDC_USER_CLAIM, the development user, a client of the client credentials flow) gets its own ABAP name, given at its first request and kept inrapt_abap_user(idp_id,abap_nameunique), created at the first use like the views of the UI (D51), outside the schema of the business objects; - the name is the identifier in upper case when it fits in 12 characters and no other identifier has it; otherwise a generated name
CB+ 10 digits from the sequencerapt_abap_user_seq(fromCB9980000001, the form of the user IDs of SAP BTP); a name, once given, never changes; - several processes (instances, serverless functions) give the names through the unique constraints of the table (
ON CONFLICT DO NOTHING, then read again): the first one wins, the others read its name; - the OData service and the MCP server resolve the name after the authentication, for every request; the names are kept in memory per process;
- in every mode: it is a matter of security, not a difference with SAP.
- each identifier of the identity provider (
- Why: the same ABAP code as on SAP (
CreatedBy = sy-uname,aspect user) stays correct whatever the identifiers of the provider; the short identifiers (Keycloak usernames,DEV_USER) keep their readable name, as before. - Tests:
runtime/test/abap-users.test.ts(short identifier kept, two long identifiers with the same beginning, a name already taken, the names kept in the database, the administrative fields written through MCP).
D115 — The user menu of a standalone application
- Context: the shell bar with the avatar, the user menu and Sign Out (D37) was shown only when the application is opened behind a launchpad. Deployed alone with browser sessions (
AUTH_MODE=oidc), an application had no way to show who is signed in nor to sign out: testers sharing a demo under several users (a requester, an agent, a manager) had to type/auth/logout. They also could not tell which generated ABAP name (CB…, D114) is theirs in Created By. On the Object Page, the title of a section with a form was not shown: a section with one sub-section shows the title of the sub-section in place of its own (OpenUI5), and the sub-section was generated withshowTitle="false". - Decision: bar of the application is shown with the avatar (initials), and its menu gives the name, the identifier, the ABAP name (
$permissions, D114) when it differs, the roles and Sign Out (/auth/logout: the session and the IdP session); shell bar, as before; behind a launchpad, its shell bar, as before;- when
/launchpad/configdoes not answer, the UI reads/auth/me; with a session, the shell bar of the application is shown with the avatar (initials), and its menu gives the name, the identifier, the ABAP name ($permissions, D114) when it differs, the roles and Sign Out (/auth/logout: the session and the IdP session); /auth/mereturnsinitialsandlogoutas well (no cache);- without browser sessions (development, bearer tokens only),
/auth/medoes not exist: no shell bar, as before; behind a launchpad, its shell bar, as before; - a section of the Object Page with one form shows its title; a table keeps it in its toolbar.
- when
- Why: SAP Fiori apps always show the user and the sign-out in the shell; the identity of the signed-in user matters as soon as authorizations differ by user.
- Tests:
runtime/test/ui-user-menu.test.ts(browser: login at a test OIDC provider, avatar, menu with the identifier, ABAP name and roles, sign-out at the provider),runtime/test/auth-session.test.ts(/auth/me),compiler/test/ui.test.ts(section titles).
D116 — The avatar of a standalone application in the title of the page
- Context: D115 showed, above the pages of a standalone application with browser sessions, a shell bar with the title of the application and the avatar. Under it, the title of the List Report repeats the same name: on a phone the two bars take a fifth of the screen for one title and one avatar.
- Decision: and the avatar is in the
navigationActionsof the title of the List Report, of the Object Page (ObjectPageDynamicHeaderTitle) and of the Overview Page, at the right of the title; (openUserMenu): the avatar of a page and the one of the shell bar of a launchpad open the same menu;- standalone with browser sessions, no shell bar:
/auth/mefillsui>/me(notui>/shell), and the avatar is in thenavigationActionsof the title of the List Report, of the Object Page (ObjectPageDynamicHeaderTitle) and of the Overview Page, at the right of the title; - the user menu (names, ABAP name, roles, Sign Out) belongs to the component (
openUserMenu): the avatar of a page and the one of the shell bar of a launchpad open the same menu; - behind a launchpad, its shell bar as before (D37); without browser sessions, no avatar.
- standalone with browser sessions, no shell bar:
- Why: a SAP Fiori elements application without a launchpad has no shell bar of its own; the title of the page is where its actions sit, and on a phone every line counts.
- Tests:
runtime/test/ui-user-menu.test.ts(browser: no shell bar, the avatar in the title, its menu and the sign-out),runtime/test/launchpad-ui.test.ts(the shell bar behind a launchpad).
D117 — Exact packed arithmetic from @abaplint/runtime 2.14.41
- Context: since M4 the arithmetic of the abaplint runtime on packed numbers (
p) went through JavaScript numbers (D8, KNOWN_GAPS.md):12345678901234567.89 + '0.01'lost its last digits, and D90 of the roadmap considered rewriting every arithmetic expression of the behavior pools to fix it.@abaplint/runtime2.14.41 (with@abaplint/transpiler2.14.41 and@abaplint/core2.120.126) computes+,-,*andMODexactly when one operand is apand the other one ap, anior anint8, on scaledBigIntvalues. Checked again on the new versions: the division (/) still goes through a JavaScript number (with anfoperand the calculation type isf, as on SAP); theint8bounds ofLOOP AT … FROM … TOstill mixBigIntand numbers (the rewriting pass keeps itsCONV i( … ), D80); an enumerated object converted to text still gives its base value (the kernel keeps its conversion, D80); abaplint now types the existence checkSELECT SINGLE @abap_true … INTO @DATA(x)(c LENGTH 1), the other inlineSELECTtargets of D80 are stillvoid.@abaplint/core2.120.126 also types a field of a table whose built-in type isUTCLONGasutclong(it wasc LENGTH 27), and the database schema that@abaplint/transpiler2.14.41 builds in every run (not used here: D9) rejects that type, so a project with autclongcolumn (abap.utcl,abp_lastchange_utcl) no longer transpiled. - Decision: the project moves to these versions and relies on the abaplint runtime for the exact addition, subtraction, multiplication and
MODof packed numbers; nothing is rewritten in our layers (rule 3 of AGENTS.md). The division andUPDATE dbtab SET col = @valuestay known gaps; the rest of D80 is unchanged (the declaration of the existence check by the rewriting pass is kept: it gives the same type,abap_boolean). The shadow tables given to the transpiler (D19, D26) declare autclongcolumn asCHAR 27, the type abaplint gave it so far: the ABAP code sees the same type as before and the kernel converts it as before; the data elements of typeUTCLONG(utclongin ABAP) are unchanged. - Why: the most common calculations of a behavior pool on amounts and quantities (totals, price × quantity, discounts as a difference) become exact without a rewriting pass of our own; the remaining gap is smaller and documented precisely.
- Tests:
runtime/test/rap-variant-sql-writes.test.ts(( x + 1 ) * 3 - x - xandMOD 7on a packed number of 29 digits, written by the kernel and read back exactly from PostgreSQL),compiler/test/abap-generate.test.ts(a table entity with anabap.utclcolumn read by ABAP SQL transpiles).
D118 — The copy action of an instance hierarchy
- Context: SAP released the RAP copy action with ABAP 9.16 / SAP BTP ABAP environment 2508 (feature table).
rapt checkansweredBDEF003 unknown statement ignored: copy action …, and the BO had no such action. What SAP documents:copy action [( features : instance | global, precheck, authorization : none | update | global | instance, lock : none )] Name [external 'Name'];, a RAP hierarchy action that duplicates a node of an editable treeview; it is written only in the curly brackets ofinstance hierarchy; it is an instance-bound factory action (%cidof the result instance), implemented by the application in a handlerFOR MODIFYof the behavior pool; managed and unmanaged BOs; a projection or interface BDEF reuses it withuse action(glossary). the CDS hierarchy of the entity, and in brackets the optional copy action and reorder action (reorder action, withfield ( hierarchy-index ),ascending association,descending association … { with cascading delete; }); not allowed in a projection or interface BDEF, whose hierarchy actions are reused withuse action. for each%keyof an instance-bound factory action, the created instances are inmapped.Hierarchy.RecursiveHierarchyActions/CopyAction: a bound action without parameter returning the copy of the node (Template_CopyAction); the parent of the copy is then set by a PATCH of the parent navigation property.copy action:copy action [( features : instance | global, precheck, authorization : none | update | global | instance, lock : none )] Name [external 'Name'];, a RAP hierarchy action that duplicates a node of an editable treeview; it is written only in the curly brackets ofinstance hierarchy; it is an instance-bound factory action (%cidof the result instance), implemented by the application in a handlerFOR MODIFYof the behavior pool; managed and unmanaged BOs; a projection or interface BDEF reuses it withuse action(glossary).instance hierarchy CDSHierarchy { … }: the CDS hierarchy of the entity, and in brackets the optional copy action and reorder action (reorder action, withfield ( hierarchy-index ),ascending association,descending association … { with cascading delete; }); not allowed in a projection or interface BDEF, whose hierarchy actions are reused withuse action.- The factory actions: for each
%keyof an instance-bound factory action, the created instances are inmapped. - OData: the vocabulary Hierarchy of SAP names the copy action of a recursive hierarchy in
Hierarchy.RecursiveHierarchyActions/CopyAction: a bound action without parameter returning the copy of the node (Template_CopyAction); the parent of the copy is then set by a PATCH of the parent navigation property.
- Decision: additions and
external; the other statements of the block are kept as text (instance,hierarchyandcopystay usable as names). cardinality[1],copy: true) of the entity, so that everything a factory action has applies: derived types with%cidand%tky, the handlerFOR MODIFY … FOR ACTION(ABP002 when it is missing), feature control, precheck, authorization, the run in the transaction of a draft (D81, D110),use actionin a projection, EMLEXECUTE. The entity behavior keepsinstanceHierarchy(the CDS hierarchy, the copy action). or a name taken by another action; BDEF033 wheninstance hierarchynames something that is not a CDS hierarchy (D108) whose source is the entity, or appears twice; BDEF012 in a projection BDEF. The other statements of the block (reorder action, hierarchy index field, ascending and descending associations),lock : none,authorization : …andexternalare BDEF003 warnings: not supported yet. an exposed entity with a recursive hierarchy (D108) whose behavior exposes a copy action getsHierarchy.RecursiveHierarchyActionswith the qualifier of its hierarchy andCopyAction, the action qualified by the namespace of the service.#FOR_ACTION, it is a button like a factory action: the copy opens. The UI has no tree table (D108).- The BDEF parser reads
instance hierarchy Name { … }and itscopy actionwith the additions andexternal; the other statements of the block are kept as text (instance,hierarchyandcopystay usable as names). - The IR makes the copy action an instance-bound factory action of one instance (
factory, cardinality[1],copy: true) of the entity, so that everything a factory action has applies: derived types with%cidand%tky, the handlerFOR MODIFY … FOR ACTION(ABP002 when it is missing), feature control, precheck, authorization, the run in the transaction of a draft (D81, D110),use actionin a projection, EMLEXECUTE. The entity behavior keepsinstanceHierarchy(the CDS hierarchy, the copy action). - Checks as SAP: BDEF034 for a copy action outside
instance hierarchy, a second copy action, or a name taken by another action; BDEF033 wheninstance hierarchynames something that is not a CDS hierarchy (D108) whose source is the entity, or appears twice; BDEF012 in a projection BDEF. The other statements of the block (reorder action, hierarchy index field, ascending and descending associations),lock : none,authorization : …andexternalare BDEF003 warnings: not supported yet. - OData: the copy action is a bound action returning the entity type, like a factory action; an exposed entity with a recursive hierarchy (D108) whose behavior exposes a copy action gets
Hierarchy.RecursiveHierarchyActionswith the qualifier of its hierarchy andCopyAction, the action qualified by the namespace of the service. - The generated UI: no button of its own; annotated
@UI.lineItemor@UI.identification#FOR_ACTION, it is a button like a factory action: the copy opens. The UI has no tree table (D108).
- The BDEF parser reads
- Why: SAP defines the copy action as an instance-bound factory action implemented by the application, so the runtime of the factory actions is its exact semantics; nothing of it is managed by the framework. The checks are those the documentation states.
- Assumptions (SAP is silent, to confirm on SAP BTP 2508+): the cardinality of the result is one instance (the Template_CopyAction of the vocabulary returns the copy of the node); the source of the CDS hierarchy is the entity of the behavior; the
$metadataof SAP carries the copy action inHierarchy.RecursiveHierarchyActionswith the namespace of the service (not the alias); whether the descendants are copied is the choice of the handler (the vocabulary says the descendants are copied, the BDEF leaves the implementation to the application). - Tests:
compiler/test/bdef-parser.test.ts(the example of the keyword documentation with every statement of the block and the additions, a copy action outside the block, the namesinstance,hierarchy,copy);compiler/test/ir.test.ts(the model of the action and its handler, ABP002, BDEF033, BDEF034, BDEF003, BDEF012);runtime/test/rap-copy-action.test.ts(a BO of nodes:$metadata, the copy by the behavior pool and the recursive hierarchy that shows it, its feature control; a draft BO of folders through projections: the copy of a folder of the draft is a draft, kept by the activation).
D119 — RAP change documents
- Context:
changedocumentswas ignored (BDEF003) and listed ❌: a managed BO of SAP that logs its changes (ABAP 9.16, SAP BTP ABAP environment 2508) built, but recorded nothing. The roadmap planned "change documents written by the managed runtime" in phase 4 (provisional D89). - SAP semantics (read in full): RAP -
changedocuments, RAP -changedocuments, Options, the feature table, the RAP guide Integrating Change Documents and Evaluating Change Document Data, Reading Change Documents and Writing Change Documents, the sample ofSAP-samples/abap-platform-reuse-services(a change document object, data elements with Change Document Logging, a custom entity reading throughcl_chdo_read_tools). In short: managed BOs only, strict mode and a persistent table required; one change documents master per BO with its change document object (only its name matters: the options of the object are not evaluated), dependents below it forming a tree,by _Assocto the master or the ancestor association; optionscreate/deletenone|key|data,updatenone|data, each once, at least one, defaultscreate : key, update : data, delete : key; relevant fields typed with a data element with the change document flag or a CDS simple type with@AbapCatalog.typeSpec.changeDocumentRelevant: true; no code in the behavior pool; the active persistence is logged (an instance created and changed in a LUW is a creation with its last values); actions are logged by the standard operations they run; a projection or an interface reuses the documents of its base;asynchronouswrites with the background processing framework the data determined at save;utcrecords the time in UTC rather than the system time zone;for persistent tablesis not available in ABAP Cloud. Released on SAP BTP (Cloudification Repository):CL_CHDO_READ_TOOLS,CL_CHDO_WRITE_TOOLS,CL_CHDO_DELETE_TOOLS,CL_CHDO_OBJECT_TOOLS_RELand their exceptions;I_ChangeDocument_2andC_ChangeDocument_2, named by the RAP guide for a Fiori display, are not in the SAP BTP set. - Decision: dependent [by _Assoc]
and the body statementchangedocuments ( … );; the IR checks them as SAP: BDEF035 (strict mode, persistent table, one master, dependents below it and forming a tree,byleading to the master,for persistent tables, unknown additions), BDEF036 (logging options), BDEF037 (change document object not in the sources), DDIC011 (unreadable.chdo.xml). A projection BDEF that writes them gets BDEF012, as SAP reuses the base.LOGFLAGof a DTEL and the annotation of a DRTY make a field relevant. The model hasEntityBehaviorModel.changeDocuments(kind, object,by,asynchronous,utc, logging options, relevant elements) andservices.changeDocuments. number fromrapt_change_number_seqon 10 digits, user, date, time, change indicator,utc) andrapt_change_document_item(as CDPOS: CDS entity, key, element, label, indicator, old and new value). master the items of each created, changed or deleted instance it writes (not those of an unmanaged save, nor drafts):key→ aKEYitemIorD;data→ theKEYitem and oneJorEitem per relevant field with a value;update : data→ oneUitem per relevant field whose value changed; the header indicator isI,DorUafter the master instance; no document without items. They are written in the same database transaction as the instances.CDREDADD,cx_chdo_read_error) reads them, with the kernel methodchdo_read; the database filters them (the object class, the period of change on the index of the table, the range tables of the object IDs, users and change numbers translated to SQL byruntime/src/abap/ranges.ts, the items left out withonly_headers), so that a read does not load every document of the object class. changed instance, in character form; TABNAME the CDS entity and FNAME the element, upper case; the items ofdataas the classic field documentation (J,E).asynchronousis written in the commit (same result after the commit);utc` changes nothing (UTC is the system time zone, D40). See KNOWN_GAPS.md.- The BDEF parser reads
changedocuments master [asynchronous] [utc] ( Object ),changedocuments dependent [by _Assoc]and the body statementchangedocuments ( … );; the IR checks them as SAP: BDEF035 (strict mode, persistent table, one master, dependents below it and forming a tree,byleading to the master,for persistent tables, unknown additions), BDEF036 (logging options), BDEF037 (change document object not in the sources), DDIC011 (unreadable.chdo.xml). A projection BDEF that writes them gets BDEF012, as SAP reuses the base. - The change document object is read from its abapGit file (
<CHDO>; tables and text kept);LOGFLAGof a DTEL and the annotation of a DRTY make a field relevant. The model hasEntityBehaviorModel.changeDocuments(kind, object,by,asynchronous,utc, logging options, relevant elements) andservices.changeDocuments. - The generated database has
rapt_change_document(as CDHDR: object class, object ID, change number fromrapt_change_number_seqon 10 digits, user, date, time, change indicator,utc) andrapt_change_document_item(as CDPOS: CDS entity, key, element, label, indicator, old and new value). - The managed save, after the late numbering and before the write, gathers per instance of the master the items of each created, changed or deleted instance it writes (not those of an unmanaged save, nor drafts):
key→ aKEYitemIorD;data→ theKEYitem and oneJorEitem per relevant field with a value;update : data→ oneUitem per relevant field whose value changed; the header indicator isI,DorUafter the master instance; no document without items. They are written in the same database transaction as the instances. cl_chdo_read_tools=>changedocument_read(clean room, public signature, DDIC structureCDREDADD,cx_chdo_read_error) reads them, with the kernel methodchdo_read; the database filters them (the object class, the period of change on the index of the table, the range tables of the object IDs, users and change numbers translated to SQL byruntime/src/abap/ranges.ts, the items left out withonly_headers), so that a read does not load every document of the object class.- Assumptions where SAP is silent: object ID = key of the master instance, table key = key of the changed instance, in character form; TABNAME the CDS entity and FNAME the element, upper case; the items of
dataas the classic field documentation (J,E).asynchronousis written in the commit (same result after the commit);utcchanges nothing (UTC is the system time zone, D40). See KNOWN_GAPS.md.
- The BDEF parser reads
- Why: change logging is declarative in RAP: the BO of SAP must log the same changes here without code, and the read API released on SAP BTP keeps the behavior pools portable. Writing in the save transaction keeps the documents consistent with the data (a rolled back save writes none).
- Tests:
bdef-parser.test.ts(the syntax and its positions);ir.test.ts(the model, the relevance of a data element and of a CDS simple type, BDEF035, BDEF036, BDEF037, DDIC011);rap-change-documents.test.ts(variant of the Travel fixture: an update with old and new values, a field not relevant,update : none, an action, a deep create, a cascading delete, the read throughcl_chdo_read_toolsin a function, with a period and the headers only);abap-ranges.test.ts(every option of a range table, the signs, the patterns, on PostgreSQL).
D120 — dependsOn of a JSON batch
- Context: D95 read the JSON batch of OData 4.01 but not
dependsOnnorif: the requests ran in their order and a request ran even when the one it needed had failed. Since release 2608, the ABAP environment of SAP BTP supportsdependsOn("Operation Dependency Management in JSON $batch", SAP Help, ABAP Cloud): inside an atomicity group, the RAP runtime then serializes the phases of the dependent operations, and the group is still one commit; S/4HANA Cloud APIs document$<id>references to the result of a previous request ($100,$100/_BillingPlanItem, also for aPATCH). SAP leaves out the references to an ETag and to a value of the response body (sections 19.3 and 19.4 of OData JSON 4.02) and asynchronous batches; it says nothing ofif. It announces the JSON batch withCapabilities.BatchSupport(SupportedFormats), which D95 already writes. OData JSON 4.01, section 19:dependsOnlists the ids or atomicity groups of preceding requests (no forward reference), a request whose dependency failed (a status other than 2xx) is not executed and answers424 Failed Dependency, a$<id>reference must be listed independsOn, a service withoutifanswers 424 for the request and for each request of its atomicity group; the response carries theatomicityGroupof its request. - Decision: the id of a preceding request or a preceding atomicity group; an unknown name, a forward reference (so any cycle), the own atomicity group of the request, a
$<id>reference to a later request, an id used twice, or an id that is also an atomicity group is rejected with a message naming the request; (D95 accepted it without, and a failed creation now answers 424 rather than an unknown reference);$<id>is the entity created by aPOSTor updated by aPATCH/PUT; valid order): a request whose dependency failed is not executed, 424 with the codeFAILED_DEPENDENCYand the name of the failed dependency; an atomicity group with such a request, a dependency outside the group, is not executed: 424 for each of its requests; a failed group fails all its ids and its name; dependencies inside a group are already met by the order of the LUW (D23), the group failing as one; requires of a service without request dependency conditions, rather than being run without its condition; themg1,g2…).- parsing (400 for the whole batch, nothing executed):
dependsOnis an array of names, each the id of a preceding request or a preceding atomicity group; an unknown name, a forward reference (so any cycle), the own atomicity group of the request, a$<id>reference to a later request, an id used twice, or an id that is also an atomicity group is rejected with a message naming the request; - a
$<id>reference at the start of a URL is a dependency even whendependsOnomits it (D95 accepted it without, and a failed creation now answers 424 rather than an unknown reference);$<id>is the entity created by aPOSTor updated by aPATCH/PUT; - execution, in the order of the requests (dependencies always point backwards, so it is a valid order): a request whose dependency failed is not executed, 424 with the code
FAILED_DEPENDENCYand the name of the failed dependency; an atomicity group with such a request, a dependency outside the group, is not executed: 424 for each of its requests; a failed group fails all its ids and its name; dependencies inside a group are already met by the order of the LUW (D23), the group failing as one; ifstays out, as on SAP: the request (and its atomicity group) answers 424, as OData 4.01 requires of a service without request dependency conditions, rather than being run without its condition;- the response of a request of an atomicity group carries the name of its group (D95 named them
g1,g2…).
- parsing (400 for the whole batch, nothing executed):
- Why: the dependent requests of a client (update then create, create then act) must not run when what they need failed, and the order of SAP is the one of the dependencies. Running the requests in their order keeps the change set of D23: SAP's restrictions (only RAP entities in a group with dependencies, navigation paths resolved before the change set) do not arise, every writable entity of the runtime has a behavior definition and the paths are resolved request after request;
continue-on-errorneeds nothing more, every request is processed according to its dependencies, the default of OData 4.01. - Tests:
runtime/test/odata-write.test.ts(a chain through an atomicity group and a$<id>reference; 424 for a failed request, a failed dependency of a dependency, a group depending on a failed request; a dependency on a failed group and on one of its requests; a failed$<id>withoutdependsOn;if;$<id>of aPATCH; the 400 of an unknown name, a forward reference, a cycle, the own group, a later$<id>, a wrongdependsOn, a duplicate id, an id that is a group).
D121 — OpenUI5 1.154
- Context: the UI, the launchpad and the documentation (D10, D27, D37) ran on OpenUI5 1.136, a long-term maintenance line whose maintenance ended in Q3/2026 (version overview of OpenUI5,
versionoverview.json, 2026-11-30). 1.154 is the latest version on npm, in maintenance (mid-term support until Q3/2027, cumulative patches until Q3/2028); the current long-term line is 1.148, maintained until the same quarter. The deprecations from 1.136.22 to 1.154.0 (sap.m.ActionSheet,JSONModel#getObject,sap.m.NotificationList*,sap.m.PDFViewerevents,IAccessKeySupport, analytical and V2 tree bindings…) touch no API of the generated UI; the bootstrap (async,compat-version="edge",sap_horizon) andless-openui50.12.0 compile and run as before. - Decision: transitive dependency); version of each library), as a UI5 build would write it: the theming of the 1.154 core requests it on every start, and its absence logged an error and a 404;
- the runtime and
@open-rap/clipin the@openui5/*packages at 1.154.0 (Apache-2.0, no new transitive dependency); /resources/sap-ui-version.jsonis served from thepackage.jsonof the packages (name and version of each library), as a UI5 build would write it: the theming of the 1.154 core requests it on every start, and its absence logged an error and a 404;- the generated code keeps
minUI5Version1.136.0: it uses no newer API.
- the runtime and
- Why: a maintained version, the latest one, with the same end of maintenance as the long-term line; nothing to rewrite in the generated UI.
- Tests:
runtime/test/ui-resources.test.ts(version info, sources, Horizon theme compiled with less-openui5),runtime/test/ui.test.ts(sap/ui/VersionInfoloads in the browser), and the browser tests of the UI, the launchpad and the floorplans unchanged on 1.154.
D122 — OAuth 2.0 client credentials for the destinations
- Context: a destination (D31) authenticated with basic, a fixed bearer token or headers. Many APIs, those of SAP BTP (XSUAA, IAS) and most cloud APIs, want an OAuth 2.0 access token of a short lifetime: a fixed
_TOKENstops working after a few minutes. On SAP, an outbound communication user or a destination of SAP BTP (OAuth2ClientCredentials) gets the token itself. - Decision: (
basic, the default: HTTP basic with the form-encoded ID and secret of RFC 6749 section 2.3.1;post: in the body),_SCOPEand_TOKEN_PARAMS(a JSON object of further parameters,audienceorresource); with_TOKEN_URLthe kernel asks for a token (grant_type=client_credentials) and sends it asAuthorization: Bearer, over the authorization of_USERand_TOKEN; the end of its lifetime (a tenth of a short one; withoutexpires_in, until refused); a401answer to a kept token forgets it and tries once more with a new one; ABAP code sets its ownAuthorizationheader is sent as is;_TOKEN_PARAMSor_HEADERSthat is not a JSON object) raisescx_http_dest_provider_error(/iwbep/cx_cp_remotefor the client proxy) when the destination is created; an error of the authorization server is the text of the exception of the call.- variables
DESTINATION_<NAME>_TOKEN_URL,_CLIENT_ID,_CLIENT_SECRET,_CLIENT_AUTH(basic, the default: HTTP basic with the form-encoded ID and secret of RFC 6749 section 2.3.1;post: in the body),_SCOPEand_TOKEN_PARAMS(a JSON object of further parameters,audienceorresource); with_TOKEN_URLthe kernel asks for a token (grant_type=client_credentials) and sends it asAuthorization: Bearer, over the authorization of_USERand_TOKEN; - the token is kept in memory per client, one token request at a time, until 30 seconds before the end of its lifetime (a tenth of a short one; without
expires_in, until refused); a401answer to a kept token forgets it and tries once more with a new one; - the HTTP client and the OData client proxy both go through
exchangeWith; a request whose ABAP code sets its ownAuthorizationheader is sent as is; - a wrong variable (
_TOKEN_URLwithout_CLIENT_ID, an unknown_CLIENT_AUTH, a_TOKEN_PARAMSor_HEADERSthat is not a JSON object) raisescx_http_dest_provider_error(/iwbep/cx_cp_remotefor the client proxy) when the destination is created; an error of the authorization server is the text of the exception of the call.
- variables
- Why: the client credentials grant is the one of a server calling an API without a user, the only authentication of SAP outbound communication users besides basic and certificates. The authorization code grant (and PKCE) needs a user in a browser, the password grant is deprecated by the OAuth 2.0 Security BCP; user propagation (SAML bearer, token exchange) and client authentication by certificate or
private_key_jwtstay in KNOWN_GAPS.md. - Tests:
runtime/test/http-client.test.ts(the variables and their errors, basic and post client authentication, further parameters, lifetime of the token with a fake clock, concurrent calls, errors of the authorization server, the 401 retry, an ownAuthorization),runtime/test/rap-variant-remote.test.ts(the OData V2 client proxy of a behavior pool behind a mock authorization server: the token request, its reuse, a revoked token, a wrong secret),compiler/test/app-scaffold.test.ts(the.env.exampleand the README of the application).
D123 — OAuth 2.0 refresh tokens for the destinations
- Context: many APIs (energy, home automation, the consumer APIs of the cloud) give no client credentials (D122): the owner of the account consents once in a browser (authorization code grant) and the application holds a refresh token. Many providers replace the refresh token at each use and invalidate the previous one: a refresh token kept only in memory, or only in the environment, is lost at the next restart.
- Decision: the variables of D122; without
_CLIENT_SECRET, a public client (its ID in the body); reference) and kept in the tablerapt_oauth_refresh_token(destination, SHA-256 of the refresh token of the environment, refresh token encrypted), created at the first use; it is read in the transaction of the running LUW and written when that LUW ends, committed or rolled back (afterEndof the LUW context), on a connection of its own; from it; the refresh token), else the text of the exception says to set a new refresh token. with a key derived (HKDF-SHA256) from the refresh token of the environment, the destination and the SHA-256 of the row bound as additional data: the database alone, a backup or a copy of it, does not give the refresh token, and no other variable is needed. A value that cannot be decrypted (kept in clear text before, changed in the table) is ignored with a warning: the refresh token of the environment is used.DESTINATION_<NAME>_REFRESH_TOKEN: the refresh token grant (grant_type=refresh_token) with the variables of D122; without_CLIENT_SECRET, a public client (its ID in the body);- a new refresh token of the provider is used at once (the memory of the process is the reference) and kept in the table
rapt_oauth_refresh_token(destination, SHA-256 of the refresh token of the environment, refresh token encrypted), created at the first use; it is read in the transaction of the running LUW and written when that LUW ends, committed or rolled back (afterEndof the LUW context), on a connection of its own; - a new refresh token in the environment (a new consent) has another SHA-256: it starts again from it;
- an
invalid_grantanswer: the table is read once more (another instance may have replaced the refresh token), else the text of the exception says to set a new refresh token. - the refresh token of the table is encrypted (AES-256-GCM,
v1.<iv>.<cipher text>.<tag>) with a key derived (HKDF-SHA256) from the refresh token of the environment, the destination and the SHA-256 of the row bound as additional data: the database alone, a backup or a copy of it, does not give the refresh token, and no other variable is needed. A value that cannot be decrypted (kept in clear text before, changed in the table) is ignored with a warning: the refresh token of the environment is used.
- Why: written in the transaction of the LUW, the new refresh token would be lost with a rollback although the provider has invalidated the previous one; written during the LUW on another connection, it would wait for the end of the LUW with PGlite (one connection). The authorization code grant itself needs a user in a browser: the first refresh token comes from a consent done outside the application. The key comes from the secret the row already belongs to: whoever reads the environment holds the refresh token anyway, whoever reads only the database does not.
- Tests:
runtime/test/http-client.test.ts(the grant, the store, a public client, the refresh token of another instance, a new consent, the encryption and its binding, a value that cannot be decrypted),runtime/test/rap-variant-remote.test.ts(a behavior pool behind a mock provider that replaces the refresh token at each use: the row of the table, a restart that reads it, a revoked refresh token),compiler/test/app-scaffold.test.ts.
D124 — The outbound authentication methods of ABAP Cloud for the destinations
- Context: a user of outbound communication of a communication system of ABAP Cloud authenticates with a user and a password, an X.509 client certificate, OAuth 1.0 or OAuth 2.0 (client credentials), whose client authenticates with a secret (Basic), mTLS, a JWT or nothing (None). D31, D122 and D123 covered basic, a bearer token, headers and OAuth 2.0 with a secret.
- Decision: allowed, or the path of a file) and
_CA(authorities trusted for the server, added to the ones of Node.js); checked when the destination is created (cx_http_dest_provider_error);_CLIENT_AUTH=mtls(RFC 8705, the client ID in the body) or_CLIENT_AUTH=jwt(RFC 7523private_key_jwt: a JWT signed with the key, RS256, ES256 to ES512 or EdDSA by the type of the key, 5 minutes, audience the token endpoint,x5tandx5t#S256of the certificate or_CLIENT_KEY_IDaskid, signed byjose);_CLIENT_AUTH=none: the client ID only;_OAUTH1_TOKEN_SECRET,_OAUTH1_SIGNATURE_METHOD(HMAC-SHA1,HMAC-SHA256),_OAUTH1_REALM; each request signed with a new nonce, the query and a form body in the signature; it excludes OAuth 2.0; no client certificate without theundicipackage): redirects on the same origin only, the certificate is not shown to another server; the outgoing proxy is not used (KNOWN_GAPS.md)._CLIENT_CERT,_CLIENT_KEY,_CLIENT_KEY_PASSPHRASE(PEM, the PEM itself with\nallowed, or the path of a file) and_CA(authorities trusted for the server, added to the ones of Node.js); checked when the destination is created (cx_http_dest_provider_error);- the certificate is shown to the API, unless the OAuth client authenticates with it:
_CLIENT_AUTH=mtls(RFC 8705, the client ID in the body) or_CLIENT_AUTH=jwt(RFC 7523private_key_jwt: a JWT signed with the key, RS256, ES256 to ES512 or EdDSA by the type of the key, 5 minutes, audience the token endpoint,x5tandx5t#S256of the certificate or_CLIENT_KEY_IDaskid, signed byjose);_CLIENT_AUTH=none: the client ID only; - OAuth 1.0 (RFC 5849):
_OAUTH1_CONSUMER_KEY,_OAUTH1_CONSUMER_SECRET,_OAUTH1_TOKEN,_OAUTH1_TOKEN_SECRET,_OAUTH1_SIGNATURE_METHOD(HMAC-SHA1,HMAC-SHA256),_OAUTH1_REALM; each request signed with a new nonce, the query and a form body in the signature; it excludes OAuth 2.0; - a request with a certificate or
_CAgoes throughnode:https(thefetchof Node.js takes no client certificate without theundicipackage): redirects on the same origin only, the certificate is not shown to another server; the outgoing proxy is not used (KNOWN_GAPS.md).
- Why: the same configurations as the communication systems of SAP, without a new dependency. User propagation (SAML bearer assertion) needs a signed SAML assertion and the trust of the target: a decision of its own.
- Tests:
runtime/test/destination-auth.test.ts(certificates made by openssl: a client certificate shown to a TLS server, the authority of a destination and the refusal without it, redirects, mtls and jwt client authentication checked by the server, an EC key withkid, none, the OAuth 1.0 reference request of the Twitter documentation, a signed request with its query),runtime/test/http-client.test.ts(the values of_CLIENT_AUTH),compiler/test/app-scaffold.test.ts.