Files
吴让宇 c5905a5b1e refactor: 本仓升为唯一源(原 sap-cli 源码仓归档)
方向反转:此前 SKILL.md 是「模板渲染产物」、sap-cli 是源;现 sap-cli 归档,
sap-cli-skill 承接开发与分发,SKILL.md 回归手工维护的正本。

迁移(来自 sap-cli,共 104 文件):
- tests/           692 例测试(15 个文件的内联 sys.path 改指 assets/)
- openspec/        SDD 规格与归档变更(42 文件)
- docs/            开发文档与 ADT 原理(含 dev/CLAUDE.md、AGENTS.md)
- .claude/         rules 副本 + settings.json(供 Claude Code)
- .github/ .hermes/ .pre-commit-config.yaml .editorconfig CLAUDE.md
- scripts/ 保持仅 setup.py(pack_skill.py 已随旧仓归档,不迁)

修复(迁移暴露的真实缺陷):
- assets/pyproject.toml 的 build-backend 写作 `setuptools.backends._legacy:_Backend`,
  该模块在 setuptools 中不存在 → `pip install -e` 从来装不上。改为 build_meta。
  实测:临时 venv 安装成功,sap-cli --help 正常列出 31 个命令
- pyproject readme 指向不存在的 assets/README.md(editable 安装会失败)→ 改内联文本
- pyproject urls 改指 sap-cli-skill

机制调整:
- .github/workflows/ci.yml 适配 assets/ 布局;顶部注明该工作流仅 GitHub 执行,
  本仓在 Gitee 不会自动跑
- pre-commit 增本地测试门禁(Gitee 上真正生效的那道)
- .gitignore 合并旧仓完整规则(保留 log/ 下 md 知识库入库,只忽略运行日志)
- 大文件上限 100KB→1MB(架构图 512KB)

守卫测试 tests/unit/test_repo_guards.py(10 → 18 例):
- SKILL.md 须记录 parser 全部 CLI 命令 / 铁律 1-5 须为真实小节标题 / 示例不得违反铁律 5
- references/ 规则齐备;.claude/rules 与 references 必须一致(实测抓到一次真实漂移)
- VERSION == sapcli.__version__ == README 版本
- 仓内不得再出现 pack_skill.py / skill-src(防废弃流程回潮)

698 tests OK;editable 安装与 CLI 入口经临时 venv 实测通过。
docs/RELEASING.md 重写为单源开发流程。
2026-09-11 00:40:15 +08:00

93 lines
6.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: SAP ADT 学习笔记总览
created: 2026-05-18
tags:
- SAP
- ADT
- ABAP
- learning-notes
---
# SAP ADT (ABAP Development Tools) 学习笔记
> [!info] 关于本系列
> 本系列笔记深入探讨 SAP ADT 的技术原理,覆盖从底层架构到各项开发功能的实现机制。
> 参考来源:[SAP Help Portal - ADT User Guide](https://help.sap.com/docs/abap-cloud/abap-development-tools-user-guide/about-abap-development-tools-user-guide?locale=en-US)
## 📌 什么是 SAP ADT
**ABAP Development Tools (ADT)** 是 SAP 提供的现代化 ABAP 开发工具集,基于 Eclipse 平台构建,使开发者能够在 Eclipse IDE 中进行 ABAP 开发,替代传统的 SAP GUI + SE80 开发模式。
核心特点:
- **客户端/服务器架构** — IDE 作为客户端,SAP 后端作为服务器
- **REST API 驱动** — 所有操作通过 `/sap/bc/adt/*` REST 端点与后端通信
- **多 IDE 支持** — Eclipse(当前) → VS Code2026年) → 更多 IDE
- **平台无关** — 基于 HTTP(S) 协议,任何平台均可访问
## 📂 笔记结构
### 架构与原理
| 笔记 | 说明 |
|------|------|
| [[sap-cli/01.ADT架构与通信原理\|01.ADT架构与通信原理]] | ADT 的三层架构、REST 通信层、服务发现机制 |
### 核心功能原理
| 笔记 | 说明 |
|------|------|
| [[sap-cli/02.查询代码-原理\|02.查询代码 - 原理]] | 仓库对象搜索、源代码全文搜索、Where-Used 导航 |
| [[sap-cli/03.修改代码-原理\|03.修改代码 - 原理]] | 锁定-编辑-解锁-激活工作流、源代码读写 |
| [[sap-cli/04.检查代码-原理\|04.检查代码 - 原理]] | 语法检查、ATC 代码质量检查、静态分析 |
| [[sap-cli/05.提交与传输-原理\|05.提交与传输 - 原理]] | 传输请求管理、传输发布、版本管理 |
### 实践
| 笔记 | 说明 |
|------|------|
| [[sap-cli/06.ADT测试代码\|06.ADT测试代码]] | Python 测试脚本:连接验证、服务发现、读取程序源代码 |
| [[sap-cli/07.ADT代码同步工具\|07.ADT代码同步工具]] | 完整使用指南:拉取代码、传输请求、推送代码、激活代码 |
## 测试服务器
ADT url=http://support.learningleader.com.cn:55955/sap/bc/adt?sap-client=100
user=admin2
password=654321
PROGRAM=ZIDTR_IMPORT_ACCOUNTING_ORDER
## 🔗 关键外部资源
- [SAP Help Portal - ADT User Guide](https://help.sap.com/docs/abap-cloud/abap-development-tools-user-guide/about-abap-development-tools-user-guide?locale=en-US)
- [Behind the Design: How We Transformed the ABAP Development Tools](https://community.sap.com/t5/technology-blog-posts-by-sap/behind-the-design-how-we-transformed-the-abap-development-tools/ba-p/14258121)
- [End-to-End SAP Automation with ADT REST Services and AI](https://medium.com/@onuryz.itu/end-to-end-sap-automation-with-adt-rest-services-and-ai-a-modern-alternative-to-gui-scripting-343ea86064ea)
- [Creating an ABAP in Eclipse Plug-in Using the ADT SDK](https://community.sap.com/t5/application-development-and-automation-blog-posts/creating-a-abap-in-eclipse-plug-in-using-the-adt-sdk-part-2/ba-p/13093582)
- [abap-adt-api (GitHub)](https://github.com/marcellourbani/abap-adt-api) — 开源 ADT REST 客户端
- [erpl-adt (GitHub)](https://github.com/DataZooDE/erpl-adt) — ADT REST CLI 和 MCP 服务器
## 🗺️ 技术栈一览
```
┌─────────────────────────────────────────────────────┐
│ 开发者 IDE 层 │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Eclipse │ │ VS Code │ │ 自定义 HTTP 客户端│ │
│ │ (ADT插件) │ │ (2026+) │ │ (Python/JS/AI) │ │
│ └─────┬─────┘ └────┬─────┘ └───────┬──────────┘ │
│ │ │ │ │
│ └──────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ REST over HTTP(S) │ │
│ │ /sap/bc/adt/* │ │
│ └─────────┬───────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────────┐ │
│ │ SAP ABAP 后端服务器 │ │
│ │ ┌─────────┐ ┌─────────┐ ┌───────────────┐ │ │
│ │ │ICF Handler│ │ADT REST │ │ ABAP Runtime │ │ │
│ │ │ (SICF) │ │Framework│ │ (Syntax/ATC) │ │ │
│ │ └─────────┘ └─────────┘ └───────────────┘ │ │
│ │ ┌─────────┐ ┌─────────┐ ┌───────────────┐ │ │
│ │ │Repository│ │Transport│ │ Activation │ │ │
│ │ │ (搜索) │ │ (CTS) │ │ Framework │ │ │
│ │ └─────────┘ └─────────┘ └───────────────┘ │ │
│ └──────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
```