Skip to content

v2026.09.23 — CDS delta with deletes, through SAP's own pipeline engine

Choose a tag to compare

@jrosskopf jrosskopf released this 23 Sep 16:52
· 105 commits to master since this release

SAP Note 3255746 prohibits third-party use of the ODP-RFC modules, a security patch has enforced
that since 9 June 2026, and the temporary opt-out expires at the end of the year. The note names
CDS view extraction among the paths that remain permitted. This release is that path: erpl_ape
reads CDS entities through the ABAP Pipeline Engine — the runtime SAP Datasphere itself uses for
ABAP sources — and its delta reports deletes, which a change-timestamp delta structurally
cannot, because a deleted row has no timestamp left to move.

erpl_ape is now part of the erpl bundle, so LOAD erpl loads it beside erpl_rfc,
erpl_bics and erpl_odp. Nothing is installed in SAP: no transport, no Z objects, no ABAP.
Extraction on a customer system needs a role granted on the SAP side; ape/docs/security.md is
the handout and sap_ape_check_authorizations() verifies the result rather than asking anyone to
trust it.

Added

  • [trampoline] erpl_ape is now part of the bundle, so LOAD erpl extracts, installs
    and loads it alongside erpl_rfc, erpl_bics and erpl_odp. It built correctly before this
    and was simply never embedded: the trampoline hard-codes each sub-extension name in eleven
    places, and a module missing from those lists compiles, passes its own suite, and does not
    exist for anyone who types LOAD erpl. scripts/smoke-test.sh now asserts one function per
    bundled extension — it previously checked three, all from erpl_rfc, so it could not have
    caught this.

  • [rfc] sap_rfc_authorizations() gains the erpl_ape rows. Worth reading for one fact
    they make plain: the extraction functions reach SAP through only DHAPE_GRAPH_MANAGER and
    DHAPE_GRAPH_ROUNDTRIP no matter what the pipeline does, because the graph is driven by JSON
    rather than by distinct function modules. So S_RFC says nothing about which operators a user
    may run — that is per-operator via S_DHAPEOPR, which sap_ape_check_authorizations() probes.

  • [ape] New sub-extension erpl_ape — CDS entity extraction through SAP's own ABAP
    Pipeline Engine (DHAPE_*) and its metadata browser (DHAMB_*), with no ABAP footprint.
    Its source lives in the DataZooDE/erpl-ape submodule at ape/; the binary is bundled in
    the erpl trampoline, so LOAD erpl loads it like the other sub-extensions. Extraction
    against a customer system needs a role granted on the SAP side, which is normally agreed per
    engagement — ape/docs/security.md is the handout, and sap_ape_check_authorizations()
    verifies the result.

    • PRAGMA sap_ape_ping — logs on and asks the engine for its version, so it fails when the
      DHAPE_* function group is unreachable rather than only when logon fails.
    • sap_ape_system_info() — engine version, raw capabilities JSON, and a supported flag with a
      reason when false.
    • sap_ape_show() — CDS entities with release flag, base table and package. Browses only the
      /CDS subtree; the metadata browser's root also exposes /ODP_BW and /ODP_SAPI, and
      erpl_ape never reads those.
    • sap_ape_describe() — field list whose DuckDB types come from the same DDIC mapper
      sap_read_table uses, so the two agree cell for cell. Carries the currency/unit reference.
    • sap_ape_preview() — typed sample rows that start no graph and create no subscription.
    • erpl_ape_allow_unreleased setting (default off) for entities with no release contract.
    • sap_ape_read_delta() delta including deletes — verified end to end: insert and update
      arrive as after-images (/1DH/OPERATION = 'U'), a delete as 'D' carrying only its keys. That
      is the capability ODP's byElement annotation cannot provide.
    • sap_ape_read_full() / sap_ape_read_delta() — extraction through the pipeline engine, with
      projection and server-side filters pushed into the reader. filters uses the same
      {FIELDNAME, SIGN, OP, LOW, HIGH} struct as erpl_odp. Delta surfaces the engine's own
      per-row change indicator, /1DH/OPERATION, under that name rather than an invented one.
    • sap_ape_show_subscriptions() and PRAGMA sap_ape_drop(cds_name, subscriber_process) — the
      engine keeps subscriptions after a graph ends, so they need listing and erasing. There is no RFC
      for either; both run short-lived graphs built from the engine's own subscription-reader and
      subscription-eraser operators. sap_ape_read_full erases its own subscription when the scan
      ends, so a snapshot leaves nothing behind.
    • recover => true on sap_ape_read_delta, backed by a local spill in
      erpl_ape.delta_spill. The engine commits each portion as it hands it over and has no client
      acknowledgement — measured, abandoning a scan after 5 of 180 changes lost the other 175 — so
      there is nothing on the SAP side to re-stream and durability has to be local. The spill is
      written on its own transaction, so the rollback that loses your rows cannot discard it too.
      erpl_ape_spill_enabled = false opts out, at the cost of making delta at-most-once.
    • sap_ape_check_authorizations([cds_name]) — what SAP must grant and whether the
      connected user has it, probed live with AUTHORITY_CHECK. The requirement list is read
      off the system, and its values come from the ABAP classes that perform the checks rather
      than from TOBJ, which says which fields exist and nothing about what is passed to
      them. Read verdict: one row (S_DHAPEOP) is a grant the role must not hold, because
      it is the fallback that overrides S_DHAPEOPR and silently defeats the operator
      restriction. The list doubles as the module's CDS-only posture in a form a Basis team can
      verify — S_DHAPEOPR is checked per operator name by CL_DHAPE_OPERATOR_REGISTRY, and
      the browser's SLT / ODP_SAPI / ODP_BW / table / view objects are absent by design.
      ape/docs/security.md carries the ZERPL_APE role definition and handout, and
      ape/docs/protocol.md records the class and call site behind every row.
    • erpl_ape_prepare_timeout bounds the wait for SAP's asynchronous preparation, and
      erpl_ape_delta_quiet_seconds bounds how long an already-established delta subscription waits
      for a first package before reporting that there is nothing to replicate. They are separate on
      purpose: a resumed subscription is already prepared, so minutes of waiting for "no changes"
      would be absurd, while a couple of seconds reports "no changes" when the answer is "not yet".
    • The set of pipeline operators the module will drive is compiled in; no setting widens it, and
      the reader is restricted to CDS containers.

Changed

  • [rfc] SAP_* environment variables no longer seed extension settings.
    RfcEnvironmentCredentialsProvider set six sap_* options that were never registered and never
    read — credentials come from secrets — so merely having SAP_PASSWORD exported crashed extension
    load with INTERNAL Error: Unrecognized option sap_password. The provider is removed rather than
    registered. If you relied on SAP_ASHOST/SAP_USER/SAP_PASSWORD being picked up implicitly,
    create a secret instead. The suites never caught this because they use ERPL_SAP_* names.

  • [ape] Subscriptions erpl_ape registers are named ERPL_ + your subscriber_process. The
    engine records no usable creator, so the name is the only way the module can recognise its own —
    which is what lets sap_ape_show_subscriptions() default to "ours" without hiding the durable
    delta subscriptions a caller named itself (previously the default listing showed only the
    ephemeral snapshot ones). You never spell the prefix out: sap_ape_read_delta and
    PRAGMA sap_ape_drop take the plain value, and the listing reports it unprefixed alongside the
    new subscription_name column carrying the stored form. The prefix is matched case-sensitively, so
    a third party's erpl_x is not treated as ours. Subscriptions from an earlier build carry the
    bare name:
    drop falls back to it, and a delta read that finds one refuses rather than silently
    registering a second subscription and re-running the initial load.

  • [ape] recover => true no longer contacts SAP at all. It used to resolve the entity
    against the catalogue at bind time, so it failed exactly when SAP was unreachable — the situation
    it exists for. The schema now comes from the spilled package plus the column names recorded with
    the batch, so a replay reports the same columns as the read it replaces.

  • [ape] The spill's payload column is now BLOB. A package whose bytes are not valid UTF-8
    — ordinary for SAP text in a non-UTF-8 codepage — used to abort the scan after the engine had
    committed the portion, and the error carried the whole package. An existing spill table with a
    VARCHAR payload is reported with the DROP TABLE to run rather than silently misused.

  • [ape] A value that will not convert raises instead of becoming NULL. The documented wire
    sentinels (9999-99-99, NaN, …) map to NULL deliberately, but only where the column cannot hold
    them — in a text column ? and NaN are data. Anything else names the package, row, column and a
    bounded fragment of the text. A silent NULL is a wrong answer the caller cannot see. Likewise a
    column the catalogue reports but the package does not carry is an error, not a column of NULLs.

  • [ape] An entity named by its metadata-browser path (/CDS/TMP/ZERPL_APE_D) now resolves to
    the bare name the engine stores, so a delta read spelled that way resumes instead of failing on
    its second call with "subscription already exists".

  • [ape] wireformat is validated against the four profiles the reader declares, and
    recover => false on a full read no longer raises (only a true value is refused).

Notes

  • [ape] Server-side filters are refused, not ignored, and projection is applied on the
    client.
    The pipeline reader available on current releases declares seven configuration
    properties and reads seven configuration paths — none of them a filter or a schema — so pushing
    either down would return every row while the query looked like it asked for a subset. filters
    therefore raises with the remedy (an ordinary SQL WHERE, which the streaming scan applies as
    rows arrive), and columns is honoured by mapping the package's self-describing fields. Pushdown
    returns with the next-generation reader.
  • [ape] The engine's CSV writer quotes RFC 4180 style, verified live by seeding hostile
    values: a value carrying the separator or a double quote is wrapped in quotes and an inner quote
    is doubled, while a backslash is data. The decoder parses quoted fields and additionally checks
    each row's cell count against the declared field count, because the scan assigns cells to columns
    by index and a shifted row would otherwise be plausible nonsense rather than an error.
  • [ape] Reads are slow to start, and that is the SAP side, not the client. SAP prepares an
    initial load with a background job (DHCDC "ACD"); while it is pending the engine returns neither
    data nor an error. The scan polls and, if the job never finishes, fails with a message naming the
    application log to check (object DHCDC, subobject ACP_JOB) rather than hanging.
  • [ape] com.sap.abap.cds.reader.v3 — the operator the design was originally built around — is
    not registered on the releases tested, so the module drives com.sap.abap.cds.reader.v2.

Known limitations

  • [ape] A client killed mid-scan leaves its graph running server-side, which blocks erasing the
    subscription and therefore later delta calls on that subscriber. Recovery uses the engine's own
    retention mechanism; the delta harness runs it first. Doing this automatically is not yet wired in.
  • [ape] The gen2 reader (com.sap.abap.reader, protocol v7) is unusable without driving SAP's
    agent message protocol to establish DHAPE_GRAPH-STATE_UUID. Parked; it is likely required for
    S/4HANA Public Cloud. See the submodule's docs/protocol.md.