# Abap MCP

> Instructs how to use ABAP MCP tools correctly. Use when asked to work with ABAP objects, or when planning to call ABAP_MCP tools.

- Skill: `255h/abap-mcp` (Agent Skill)
- Install (CLI): `npx skillmds@latest add 255h/abap-mcp`
- Raw SKILL.md: https://api.skillmd.com/api/skills/255h/abap-mcp/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: 255h (https://skillmd.com/u/255h)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/255h/abap-mcp

---



## When to use me

Activate this skill whenever working with SAP ABAP systems via MCP tools — especially when investigating object metadata, source code, transport assignments, or documentation. It prevents the model from querying repository tables (`e071`, `reposrc`, `tadir`, `dokil`, etc.) directly via SQL, which is the wrong approach for those tasks.

## Tool Usage Priority

### Correct workflow (always try first)
1. **`ABAP_MCP_get_urls(name, type)`** — get all available URLs for an object (source, versions, transports, documentation, etc.)
2. **`ABAP_MCP_get_content(url)`** — read a specific artifact by URL (from `get_urls` result)
3. **`ABAP_MCP_reference(url)`** — find where an object is used (where-used list). Pass the object's own URL (e.g. `/sap/bc/adt/oo/classes/ZCL_FOO`). Returns XML with referencing objects and their URI.

### Wrong patterns — DO NOT use SQL for:
- Finding what transport/request an object is in
  - `SELECT * FROM e071 WHERE ...` — instead use `get_urls(type, name)` → pick the transport URL → `get_content(url)`
- Reading source code of any ABAP object (class, program, function module, etc.)
  - `SELECT * FROM reposrc WHERE ...` — instead use `get_urls(type, name)` → pick source URL → `get_content(url)`
- Getting metadata about objects (who changed it, when, versions)
  - `SELECT * FROM tadir WHERE ...` — instead use `get_urls(type, name)` → explore relevant URLs
- Listing what objects are in a transport
  - `SELECT * FROM e071 WHERE trkorr = '...'` — instead use `get_urls(type, name)` for each suspected object
- Checking documentation of a data element, table, or class
  - SQL queries on DOKIL/DOKHL — instead use `get_urls(type, name)` → pick documentation URL → `get_content(url)`
- Finding where an object is used (where-used)
  - `SELECT * FROM reposrc WHERE data LIKE '%...%'` — instead use `ABAP_MCP_reference(url)` where `url` is the object's own URL from `get_urls` result

### When is SQL (`ABAP_MCP_sql_request`) appropriate?
Only for **querying actual table content / business data**: reading table entries, checking configuration, debugging application data. Never for ABAP repository metadata.

## Supported object types and type codes

| Object Type              | Type Code  |
|--------------------------|------------|
| Program                  | `PROG/P`   |
| Program Include          | `PROG/I`   |
| Class                    | `CLAS/OC`  |
| Interface                | `INTF/OI`  |
| Function Group           | `FUGR/F`   |
| Function Module          | `FUGR/FF`  |
| DB Table                 | `TABL/DT`  |
| Structure                | `TABL/DS`  |
| Data Element             | `DTEL/DE`  |
| Message Class            | `MSAG/N`   |
| CDS Data Definition      | `DDLS/DF`  |
| CDS Metadata Extension   | `DDLX/EX`  |
| Access Control (CDS DCL) | `DCLS/DL`  |

## Quick reference: how to handle common requests

| User asks about...                  | Action                                                  |
|-------------------------------------|---------------------------------------------------------|
| "What transport is class ZCL_FOO in?" | `get_urls("ZCL_FOO", "CLAS/OC")` → transport URL → `get_content(url)` |
| "Show me source of program ZBAR"    | `get_urls("ZBAR", "PROG/P")` → source URL → `get_content(url)` |
| "What are the fields of table ZTAB" | `get_urls("ZTAB", "TABL/DT")` — if that fails, try `get_urls("ZTAB", "TABL/DS")` |
| "Read data from table ZTAB"         | SQL is appropriate: `ABAP_MCP_sql_request("SELECT * FROM ztab")` |
| "Show me function module ZFOO"      | `get_urls("ZFOO", "FUGR/FF")` → source URL → `get_content(url)` |
| "What includes are in program ZBAR" | `get_urls("ZBAR", "PROG/P")` → source URL → `get_content(url)` (includes are referenced inside the main source) |
| "Where is class ZCL_FOO used?"      | `get_urls("ZCL_FOO", "CLAS/OC")` → take the class URL (e.g. `/sap/bc/adt/oo/classes/ZCL_FOO`) → `ABAP_MCP_reference(url)` |

### Note on DB table introspection
In some older ABAP systems, reading a DB table via `get_urls` with `TABL/DT` (actual DB table) may not work. In that case, try the same object name with `TABL/DS` (structure) — this often succeeds where the table type fails. Only fall back to SQL if both type codes fail.

