Build toolBuild tooltypeRuns at build time. Nothing of it ships in the deployed application.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

@root3287/cap-segw

A CAP build tool that compiles a CDS service into the ABAP Model Provider and Data Provider classes a SAP Gateway SEGW project expects, for OData V4 by default or V2.

Writes the ABAP half of a Gateway service from the model already maintained in CDS: cds compile srv -s all --to segw produces Model Provider Class and Data Provider Class code, OData V4 by default and V2 with --odata-version 2, and cds build --for segw puts the same step in the build pipeline. Entity sets, associations and annotations come across from the CAP definitions, and a set of @segw.* annotations carries what SEGW has and CDS does not: sortable, filterable, pageable, addressable, an ABAP DDIC type or field name, an HTTP method for a V2 action. @cap-js-community/odata-v2-adapter answers the same older clients by translating inside the CAP runtime; this leaves the runtime in the ABAP system and generates the classes that system runs.

Facts

Latestv1.1.6ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
ODataCAPABAPODatacapabilityExposing data and operations through OData, including the service model, metadata and protocol versions clients require. Version differences affect which clients can consume a service and which query features they can use.
Serves
Flavors
Node.jsJavafrom its runtime
Requires
@sap/cds^10.1.1@sap/cdsartifactThe peer range, as published.

Who is behind it

Timothy GibbonsTimothy GibbonsPersonMaintains this
In the atlas: maintains 1, contributes to 2
@Root3287
maintainer

Before choosing this

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →
PracticalFunctional boundary

The generated files are copied or deployed into the ABAP system by hand, the fourth step of its own usage list, so nothing keeps an activated service in step with the model it was generated from. Its peer dependency is @sap/cds ^9.8, so it does not install into a project on an earlier CAP release.

What it declares

Every artifact

Type
Build tool
Origin
Independently maintained
Runtime
build time

As a build tool

Declared for
^10.1.1
Distributed through
npm

Connections1

Install

npm add @root3287/cap-segw

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from Root3287/cap-segw under Apache-2.0, read
Root3287/cap-segw/README.mdOn GitHub

CAP SEGW

This is a custom SAP CAP Plugin that generates ABAP code for SEGW Model Provider Class (MPC) and Data Provider Class (DPC) definitions. It provides a bridge between modern CAP services and legacy SAP Gateway (OData V2) and (OData V4) environments, enabling interoperability with existing ABAP systems.

Many enterprise systems still rely on SAP NetWeaver Gateway (SEGW) projects to expose OData V2 services. This plugin allows developers to design and maintain their data models in CAP CDS while automatically generating the corresponding ABAP classes needed to integrate with older systems.

Features

  • Supports entity sets, associations, and annotations from CAP definitions.
  • Seamlessly integrates into the CAP build pipeline (cds build --for segw).
  • Allows custom annotations to control ABAP output generation.
  • Extensible design for future SEGW enhancements and ABAP compatibility layers.

Annotations

Since there are some annotations that are not present in CDS but can be set on SEGW, we added some annotations.

AnnotationDescriptionType
@segw.nameSet the name of the componentstring
@segw.ignoreIgnores an elementboolean
@segw.sortableEnable Sortableboolean
@segw.filterableEnabled Filterableboolean
@segw.conversionABAP Field Conversionsboolean
@segw.pageablePaginationboolean
@segw.addressableAddressableboolean
@segw.ftxt_searchFilter Text Searchboolean
@segw.subscribableAllows to be subscribableboolean
@segw.filter_requiredFiltered is requiredboolean
@segw.expandExpand Complex Typesboolean
@segw.abap.nameABAP Field Name Overridestring
@segw.abap.typeABAP DDIC Typestring
@segw.abap.multiplicityOverride multiplicity for SEGWstring
@segw.mpc.define.nameMPC Define Entity Method Namestring
@segw.set.nameSet the name of Entity/Association Setstring
@segw.association.nameSet the name of the associationstring
@segw.association.ignoreIgnore the parent side of an associationboolean
@segw.action.methodSet the HTTP method for Action (ODATAV2)string

Installation

npm install @root3287/cap-segw

Register the plugin in your CAP project:

// in cds-plugin.js
module.exports = require("@root3287/cap-segw");

Usage

cds compile srv -s all --to segw
  1. Define your entities and services in CAP CDS as usual.
  2. Annotate your services or entities using your custom SEGW annotations (if required).
  3. Run cds compile --to segw to generate ABAP classes.
  4. Copy or deploy the generated .abap files into your ABAP system for SEGW integration.

By default this will generate an ODataV4 classes. To switch to ODataV2 run with --odata-version 2 parameter.

Development

git clone https://github.com/Root3287/cap-segw.git
cd cap-segw
npm install 
npm run build
Local Testing
# install globally
npm link

# install locally
cd /path/to/your-cap-project
npm link cap-segw
In-Repository Tests
export PATH=$PATH:$(pwd)/node_modules/.bin
mkdir node_modules/@root3287 && ln -s . node_modules/@root3287/cap-segw

License

This project is licensed under the Apache 2.0 License. See the LICENSE

Apache-2.0, read

History

Latest

v1.1.6

Fixes 1

Notes
Fix
  • Action/Function Imports getting edm_set_name
  1. v1.1.5

    Changed 1

    Notes
    Changed
    • Bumped Package Version
  2. v1.1.4

    Features 1

    Notes
    Feature
    • Allowed the use of @segw.abap.name in action/function paramters
  3. v1.1.3

    Fixes 1

    Notes
    Fix
    • Typo Fix for SAP Constants
  4. v1.1.2

    Changed 2, Fixes 1

    Notes
    Fix
    • MPCV4 using string as the data type
    Changed
    • MPCV4 now use SAP Constants for data types.
    • Updated Test Packages
  5. v1.1.1

    Fixes 1

    Notes
    Fix
    • Entity Set Navigation Property Binding.
  6. v1.1.0

    Features 1, Fixes 1

    Notes
    Feature
    • Added implementation generator
    Fix
    • Referencing Association ignores @segw.abap.name
  7. v1.0.0

  8. v1.0.0-rc.6

    Fixes 1

    Notes
    Fixed
    • CI/CD
  9. v1.0.0-rc.5

    Fixes 1

    Notes
    Fixed
    • CI/CD
  10. v1.0.0-rc.4

    Fixes 1

    Notes
    Fixed
    • CI/CD
  11. v1.0.0-rc.3

    Fixes 1

    Notes
    Fixed
    • CI/CD
  12. v1.0.0-rc.2

    Fixes 1

    Notes
    Fixed
    • CI/CD
  13. v1.0.0-rc.1

    Features 4, Changed 2, Other 2

    Notes
    Added
    • Initial public release of the CAP ➜ SEGW generator supporting OData V2 and V4.
    • MPC/DPC class generation from CAP CDS with custom @segw.* annotations for names, ABAP types, sets, and associations.
    • Support for generating actions/functions, complex types, and associations across V2/V4.
    • Unit and integration test suites for writers, generators, and CDS-to-ABAP conversions.
    Changed
    • Emits ABAP DDIC types and ABAP-friendly names via @segw.abap.* overrides where provided.
    • Improved association handling to respect on-clause constraints and custom association names.
    Build/CI
    • GitLab CI pipeline with test/build, manual publish to GitLab registry, and GitHub status/release notifications.
    • GitHub Actions workflow for npm publishing (Trusted Publishing) and GitLab registry publishing.

    [1.1.6]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.6 https://github.com/Root3287/cap-segw/releases/tag/v1.1.6 [1.1.5]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.5 https://github.com/Root3287/cap-segw/releases/tag/v1.1.5 [1.1.4]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.4 https://github.com/Root3287/cap-segw/releases/tag/v1.1.4 [1.1.3]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.3 https://github.com/Root3287/cap-segw/releases/tag/v1.1.3 [1.1.2]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.2 https://github.com/Root3287/cap-segw/releases/tag/v1.1.2 [1.1.1]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.1 https://github.com/Root3287/cap-segw/releases/tag/v1.1.1 [1.1.0]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.1.0 https://github.com/Root3287/cap-segw/releases/tag/v1.1.0 [1.0.0]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0 [1.0.0-rc.6]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.6 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.6 [1.0.0-rc.5]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.5 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.5 [1.0.0-rc.4]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.4 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.4 [1.0.0-rc.3]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.3 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.3 [1.0.0-rc.2]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.2 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.2 [1.0.0-rc.1]: https://git.root3287.site/root3287/cap-segw/-/releases/v1.0.0-rc.1 https://github.com/Root3287/cap-segw/releases/tag/v1.0.0-rc.1

0downloads per week, npm
Weekly downloads for @root3287/cap-segw26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 0.27 Apr – 3 May: 124 May – 10 May: 3411 May – 17 May: 15618 May – 24 May: 26725 May – 31 May: 141 Jun – 7 Jun: 278 Jun – 14 Jun: 25415 Jun – 21 Jun: 922 Jun – 28 Jun: 3229 Jun – 5 Jul: 106 Jul – 12 Jul: 3013 Jul – 19 Jul: 1020 Jul – 26 Jul: 1527 Jul – 2 Aug: 23 Aug – 9 Aug: 2510 Aug – 16 Aug: 2717 Aug – 23 Aug: 324 Aug – 30 Aug: 1531 Aug – 6 Sept: 67 Sept – 13 Sept: 1814 Sept – 20 Sept: 421 Sept – 27 Sept: 228 Sept – 4 Oct: 25 Oct – 11 Oct: 17912 Oct – 18 Oct: 1019 Oct – 25 Oct: 0
OData
  1. launchpad-kpiPuts a number from an abap2UI5 app on a Fiori launchpad tilefrom ABAP
  2. com.sap.cds:cds-adapter-odata-v2OData V2 protocol adapter built into the CAP Java runtimefrom CAP
  3. com.sap.cds:cds-adapter-odata-v4OData V4 protocol adapter for CAP Java Application Servicesfrom CAP
  4. @cap-js-community/odata-v2-adapterExposes a CAP service as OData V2from CAP
  5. odata-fwABAP framework for OData services with one class per entityfrom ABAP
  6. @odatano/coreCAP plugin serving the Cardano blockchain as OData V4from CAP
  7. @odatano/nightgateCAP plugin indexing the Midnight blockchain, exposed as OData V4from CAP
  8. open-steamgateLocal ABAP server serving /IWBEP/ OData v2 without an SAP systemfrom ABAP
  9. open-abap-odataOData and Gateway shims serving SEGW-style services on Node.jsfrom ABAP
  10. @sap/cdsCAP Node.js runtimefrom CAP
  11. OData Batch CreatorBuilds OData batch request payloads from an uploaded $metadata filefrom ABAP

Details

Sources5
The discovery passdiscovered herechecked
npm registrydiscovered herechecked
npm registry, @root3287/cap-segwversion, releases, installschecked
github.com/git+https://github.com/Root3287/cap-segw.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesbuild-time
declared for^10.1.1
latestv1.1.6
first release
releases and cadence13, ~4d median
discovered viaThe discovery pass, npm registry
first seen in the atlas
ecosystem and domaincap, protocols-and-apis
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:root3287-cap-segw
JSON
/artifacts/root3287-cap-segw.json
MCP
Connecting an agent