@abapify/adt-rfc

中文文档
0.4.34发布于 2026/11/03MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2503

SAP RFC transport for @abapify — SOAP-over-HTTP RFC implementation (/sap/bc/soap/rfc)

原始使用文档
文档目录6 节
  1. Install
  2. Usage
  3. Parameter types
  4. Errors
  5. Limitations
  6. See also

@abapify/adt-rfc

SOAP-over-HTTP RFC transport for SAP systems. Calls classic RFC function modules (BAPIs, STFC_CONNECTION, TH_USER_LIST, custom FMs, etc.) without requiring the native libsapnwrfc SDK — by tunnelling the call through SAP's built-in /sap/bc/soap/rfc endpoint.

This package lives outside the /sap/bc/adt/* URL space. RFC is a separate transport layer from ADT — that's why it's a separate package, not a schema/contract under @abapify/adt-client.

Install

bun add @abapify/adt-rfc

Usage

import { createAdtClient } from '@abapify/adt-client';
import { createRfcClient } from '@abapify/adt-rfc';

const adt = createAdtClient({
  baseUrl: 'https://my.sap.example.com',
  username: 'DEVELOPER',
  password: '…',
  client: '100',
});

const rfc = createRfcClient({
  fetch: (url, opts) => adt.fetch(url, opts),
  client: '100',
});

const resp = await rfc.call('STFC_CONNECTION', { REQUTEXT: 'hello' });
console.log(resp.ECHOTEXT); // → "hello"
console.log(resp.RESPTEXT); // → "SAP R/3 Rel. 7.55 Sysid: TRL …"

Parameter types

Parameters and responses are modelled as loose JSON trees:

RFC typeTypeScript representation
Scalarstring | number | boolean | null
Structure{ FIELD1: …, FIELD2: … }
Table[{ FIELD: … }, { FIELD: … }]

Tables are serialised as SAP's <TABLE_NAME><item>…</item><item>…</item></TABLE_NAME> convention on the wire.

Errors

  • RfcSoapFault — the server returned a soap:Fault. Exposes faultcode, faultstring, and the raw response body.
  • RfcTransportUnavailable — the /sap/bc/soap/rfc endpoint returned 401/403/404/501. Some SAP systems disable SOAP-RFC; catch this to downgrade gracefully.

Limitations

  • SOAP-RFC only. Native libsapnwrfc binding (via node-rfc) is deliberately out of scope — track @abapify/adt-plugin-rfc-native for that future path.
  • Type encoding. SAP's SOAP-RFC wrapper does not round-trip every RFC data type perfectly. Binary fields come back as base64-looking strings; dates/times come back as SAP internal strings (YYYYMMDD, HHMMSS). Callers convert.
  • Authentication. Reuses the ADT client's session/CSRF/cookie state — no separate auth plumbing.

See also

  • Spec: docs/roadmap/epics/e13-startrfc.md
  • Reference implementation: tmp/sapcli-ref/sapcli/sap/rfc/

版本与发布记录

@abapify/adt-rfc 共发布 30 个版本,首次发布于 2026/04/21;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.34latest2026/11/034 天前
0.4.332026/11/025 天前
0.4.322026/11/025 天前
0.4.302026/10/318 天前
0.4.292026/10/308 天前
0.4.272026/10/308 天前

关于 @abapify/adt-rfc 的常见问题

@abapify/adt-rfc 是什么?

SAP RFC transport for @abapify — SOAP-over-HTTP RFC implementation (/sap/bc/soap/rfc)

如何安装 @abapify/adt-rfc?

在项目目录运行 npm install @abapify/adt-rfc,或使用 pnpm add / yarn add / bun add。

@abapify/adt-rfc 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@abapify/adt-rfc 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@abapify/adt-rfc 可以商用吗?

@abapify/adt-rfc 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@abapify/adt-rfc 的下载量有多少?

根据 npm 官方下载统计,@abapify/adt-rfc 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,503 次,日均约 83 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@abapify/adt-rfc 还在维护吗?

最新版本 0.4.34 发布于 2026/11/03(4 天前);至今共发布 30 个版本,其中过去 12 个月发布了 30 个;首次发布于 2026/04/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。