Abap Developer
A self-contained ABAP coding assistant. It does not depend on the user's wiki-knowledge/ library — every reference and template lives inside this skill so it works the same in any workspace.
When to use
Load this skill whenever the user asks to:
- write a new ABAP report, include, function module, class, or interface
- generate ALV grid output (classic / OO / SALV)
- develop a selection screen, dialog screen (Dynpro), or tabstrip control
- send e-mail with plain body, HTML, or attachment (BCS /
SO_NEW_DOCUMENT_ATT_SEND_API1) - build or call a SOAP Web Service (Proxies /
cl_http_client) - build or call an OData service via SEGW
- call a BAPI / RFC / standard function module
- implement a BAdI / User Exit / Enhancement Spot / Implicit/Explicit enhancement
- create or drive a Smart Form (
SSF_FUNCTION_MODULE_NAME) - optimize Open SQL, internal-table operations, or runtime
- diagnose a runtime error / Dump (ST22) and propose a fix
- review or refactor existing ABAP for style / 7.4+ new syntax
Do not load this skill for: pure business-process questions unrelated to code, non-ABAP languages, or pure configuration tasks (those belong in the user's wiki-knowledge/).
Workflow Decision Tree
Match the user's request to one branch, then load the matching reference(s) and template(s).
User request
├── "报表 / 列表 / ALV / SALV" → alv-patterns.md + templates/alv-*.abap
├── "选择屏幕 / 屏幕 / Dynpro" → screen.md
├── "查询数据 / 内表 / SQL / 性能" → data-processing.md
├── "日期 / 时间 / 工作日 / 月末" → date-time.md
├── "发邮件 / 邮件 / 附件" → email.md + templates/email-with-attachment.abap
├── "SmartForms / 打印 / 表单" → smartforms.md + templates/smartform-driver.abap
├── "SOAP / WebService / Proxy" → webservice-soap.md
├── "OData / SEGW / Fiori" → odata-segw.md
├── "BAdI / User Exit / 增强 / Spot" → enhancement.md
├── "BAPI / RFC / 标准 FM 调用" → bapi-call.md + templates/bapi-call.abap
├── "RFC 异步 / aRFC / bgRFC / 跨系统" → templates/rfc-async.abap
├── "IDoc / 物料分发 / ALE / 主数据推送" → templates/idoc-outbound.abap
├── "批量导入 / 替代 LSMW / 主数据批导" → templates/lsmw-replacement.abap
├── "Dump / 异常 / ST22 / 报错" → exception-dump.md
├── "代码风格 / 命名 / 评审" → code-style.md
├── "入门 / 新人 / 这 skill 怎么用" → assets/intro.md
└── general ABAP syntax questions → syntax-quick-ref.md
When the request is ambiguous, ask the user to confirm the branch before producing code. When the request clearly spans multiple branches, read the references in the order above (left wins on conflicts).
How to use this skill
- Identify the branch via the decision tree.
readthe matchingreferences/<topic>.mdfile(s) — these contain the canonical patterns, pitfalls, and the file name of the asset template to use.- Compose the answer by citing the reference section (e.g. "Following `alv-patterns.md § OO ALV basic pattern …"). Output a single, compilable code block unless the user asked for explanation only.
- When the reference points at a template file (
assets/templates/<name>.abap), copy that template as the starting skeleton and adapt it; do not rewrite from scratch. - For each code block produced, include a brief § checklist (variables → events → main → subroutines/methods) so the user can verify placement.
- After delivering, if a new pitfall or pattern emerged, write back to
references/— but do so by editing only the matching reference file; never editWIKI-SCHEMA.mdor other skills.
Output Conventions
- Indentation: 2 spaces. Always.
- Variable naming: prefix by type — see
code-style.md § Naming. - All examples assume Unicode system (
abap_true/abap_false,stringfor character,ifor integer). - Write ABAP 7.4+ whenever possible (
CONV,CORRESPONDING,VALUE,REDUCE,FILTER, table expressionsitab[ key = … ],DATA(ls_),FIELD-SYMBOLSinline). For < 7.4 systems, note the fallback in a comment. - Wrap each subroutine/ method body in
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""separators only when the file has 3+ sections; not required for small templates.
Reference Index
| File | Topic |
|---|---|
references/code-style.md |
命名规范、代码风格评审 checklist |
references/syntax-quick-ref.md |
ABAP 7.4+ 新语法、控制流、字符串、内表速查 |
references/data-processing.md |
内表循环、Open SQL、性能陷阱 |
references/alv-patterns.md |
经典 ALV / OO ALV / SALV 模式与字段目录 |
references/screen.md |
选择屏幕、Dynpro、Tabstrip Control |
references/date-time.md |
日期时间 FM、工作日、月末 |
references/email.md |
BCS / SO_NEW_DOCUMENT_ATT_SEND_API1 邮件发送 |
references/smartforms.md |
Smart Form 设计与调用驱动 |
references/webservice-soap.md |
SOAP Proxy / cl_http_client 消费 |
references/odata-segw.md |
SEGW / OData 服务定义与实现 |
references/enhancement.md |
BAdI / User Exit / Enhancement Spot |
references/exception-dump.md |
ST22 常见 Dump 与排查思路 |
references/bapi-call.md |
BAPI / RFC 调用模板 |
Asset Index
Templates live under assets/templates/. Each template ships in two formats:
| Format | Use case |
|---|---|
assets/templates/<name>.abap |
Local WorkBuddy workflow — open in editor, copy to SE38 directly |
assets/templates/<name>.md |
SkillHub-friendly mirror — the .abap source wrapped in a ```abap code block (SkillHub rejects .abap uploads). Generated automatically by scripts/build_index.py. |
Copy-then-adapt whichever file matches your target environment.
| Source (.abap) | Mirror (.md) | When to copy |
|---|---|---|
alv-classic.abap |
alv-classic.md |
经典 ALV(REUSE_ALV_GRID_DISPLAY_LVC)最常用 |
alv-oo.abap |
alv-oo.md |
需要事件 handler / 自定义按钮 / 容器类 |
alv-salv.abap |
alv-salv.md |
简单列表、改造遗留程序、代码最简洁 |
report-selector-screen.abap |
report-selector-screen.md |
标准报表选择屏幕(SELECT-OPTIONS / PARAMETERS) |
bapi-call.abap |
bapi-call.md |
调用任意 BAPI,含异常处理与返回值提取 |
email-with-attachment.abap |
email-with-attachment.md |
邮件带正文 + 附件(xlsx/pdf/zip) |
smartform-driver.abap |
smartform-driver.md |
通过 SSF_FUNCTION_MODULE_NAME 驱动 SmartForm |
idoc-outbound.abap |
idoc-outbound.md |
主数据 / 业务对象 IDoc 出站(MATMAS / ORDERS) |
lsmw-replacement.abap |
lsmw-replacement.md |
现代方式替代 LSMW:BAPI 循环 + 应用日志 + ALV 预览 |
rfc-async.abap |
rfc-async.md |
RFC 三种调用:同步 / 异步 aRFC / 后台 bgRFC(qRFC) |
入门读物:
| 文档 | 用途 |
|---|---|
assets/intro.md |
给新接手项目 / 第一次用本 skill 的同事入门读(SAP 体系、ABAP 概念、必装 TCode) |
Resources
references/
Authoritative ABAP knowledge, one topic per file. read them in context when matching a branch above. Keep them lean — code blocks only when the pattern is non-obvious; otherwise just the spec.
assets/templates/
Boilerplate .abap files. Copy into the user's workspace, then adapt variable names / fields / logic. Do not echo them into chat; cite the relative path.
scripts/
Internal utilities maintained by the skill itself; not user-facing:
scripts/build_index.py— regeneratereferences/README.md,assets/README.md, and the.mdmirrors of every.abaptemplate. Run after adding or editing any template.scripts/prepare_publish.py— build a SkillHub-uploadable release zip (drops.abapfiles, keeps the.mdmirrors, calls skill-creatorpackage_skill.py).
Publishing to SkillHub
- Run
python scripts/prepare_publish.pyfrom the skill root.
This writesdist/abap-developer.zip(the.md-only version) anddist/staging/abap-developer/(auditable staging tree). - Upload
dist/abap-developer.zipto <https://skillhub.cn/dashboard/publish>. - See
PUBLISH.mdfor the full step-by-step.
```