Content
# Tool List
[](https://github.com/liumaowen/ABAP)
[](LICENSE)
[]()
**Claude Code Assisted ABAP Development with MCP Server**
A comprehensive ABAP development workspace rule framework and MCP (Model Context Protocol) environment configuration for SAP ABAP system development, maintenance, refactoring, and testing in Claude Code.
## Table of Contents
## 📖 Overview
This project provides the following support for Claude Code in SAP ABAP development:
- **Rule Engine**: Detailed ABAP development specifications, modification processes, testing requirements
- **MCP Integration**: Connects local Claude Code with remote SAP system through MCP server
- **Workflow Automation**: Complete process definition from requirement understanding to code submission
- **Security Mechanism**: High-risk operation review, Transport Request tracking, permission management
## 🎯 Key Features
### 1. **ABAP Include Program Recursive Processing**
- Automatically identify and expand all `INCLUDE` statements
- Completely build the include tree and perform overall analysis
- Avoid partial understanding by only looking at the main program
### 2. **Complete Development Workflow**
```
Understand requirements → Analyze objects → Output plan → Confirm → Minimal change → Generate test → Manual review → Submit
```
### 3. **Rich ABAP Object Support**
| Object Type | Description | Example |
|---------|------|------|
| PROG | ABAP program/report | ZLMW_REPORT |
| CLAS | ABAP class | ZCL_LMW_ORDER |
| INTF | ABAP interface | ZIF_LMW_SERVICE |
| FUNC | Function module | Z_LMW_FM |
| FUGR | Function group | Z_LMW_FG |
| DDLS | CDS DDL source | ZLMW_I_ORDER |
| BDEF | Behavior definition | ZLMW_C_ORDER |
| SRVD | Service definition | ZLMW_SRVD_ORDER |
| MSAG | Message class | ZLMW_MSG |
| TABL | DDIC data table | ZLMW_T_LOG |
### 4. **MCP Tool Integration** (80+ ABAP tools)
- **Search**: SearchObject - query by name, type, package
- **Read**: GetSource - get object source code
- **Edit**: EditSource, WriteSource - precise modification or complete writing
- **Check**: SyntaxCheck, RunATCCheck, AnalyzeABAPCode
- **Activate**: Activate, ActivatePackage - single or batch activation
- **Test**: RunUnitTests, GetCodeCoverage - ABAP Unit execution and coverage
- **Debug**: DebuggerListen, DebuggerAttach, DebuggerStep, etc.
- **AMDP**: AMDPDebuggerStart - SQLScript debugging
### 5. **Intelligent Change Management**
- **Transport Request Tracking**: all transportable objects must be bound to requests
- **High-Risk Operation Review**: standard objects, large-scale refactoring, permission changes, etc. require confirmation
- **Minimal Change Principle**: avoid casual refactoring, scope expansion
- **Complete change before/after list**
## 📁 Project Structure
```
.
├── README.md # Project description (this file)
├── CLAUDE.md # Claude Code working guide ⭐ required reading
├── ABAP_PROJECT_RULES.md # ABAP development specifications
├── CHANGE_WORKFLOW.md # Change process definition
├── TEST_CHECKLIST.md # Testing checklist
├── OBJECT_SCOPE.md # Object scope and constraints
├── ABAP_ENV.md # SAP environment configuration
│
├── .mcp.json # MCP server configuration ⭐ needs to be filled
├── .mcp.json.example # MCP configuration example
├── .env # SAP connection credentials ⭐ needs to be filled
├── .env.example # Environment variable example
├── .vsp.json # Multi-system VSP configuration ⭐ needs to be filled
├── .vsp.json.example # VSP configuration example
│
├── .claude/ # Claude Code working directory
│
└── vsp.exe # ABAP command-line tool (24.3 MB)
```
## 🚀 Quick Start
### Prerequisites
- Claude Code IDE or claude.ai/code
- SAP S/4HANA system access permission
- ABAP basic knowledge
### 1. Clone Project
```bash
git clone https://github.com/liumaowen/ABAP.git
cd ABAP
```
### 2. Configure SAP Connection
Copy example files and fill in real information:
```bash
cp .env.example .env
cp .mcp.json.example .mcp.json
cp .vsp.json.example .vsp.json
```
Edit `.env`:
```env
SAP_URL=https://your-sap-system:port
SAP_USER=your_username
SAP_PASSWORD=your_password
SAP_CLIENT=151
SAP_LANGUAGE=EN
```
Edit `.mcp.json`:
```json
{
"name": "vsp-dev",
"command": "./vsp.exe",
"args": ["--mode", "mcp", "--system", "S4D"],
"env": {
"SAP_URL": "${SAP_URL}",
"SAP_USER": "${SAP_USER}",
"SAP_PASSWORD": "${SAP_PASSWORD}"
}
}
```
### 3. Enable MCP Service
Configure MCP in Claude Code settings:
1. Open project settings
2. Enable MCP server: `vsp-dev`
3. Load this project's `.mcp.json`
### 4. Start Development
Use Slash commands in Claude Code:
```
/read-abap # Read and explain current ABAP object
/plan-change # Plan change (output plan first, no direct modification)
/review-change # Strict code review
/generate-unit-tests # Generate or supplement ABAP Unit tests for objects
/analyze-dump # Analyze dump/log/exception
```
## 📋 Core Document Description
### 🔷 [CLAUDE.md](CLAUDE.md) — Required Reading
- Claude Code working rules in this project
- ABAP include processing rules
- SAP environment information (S4D, Client 151, DEV)
- MCP tool invocation process
- Common development process examples
### 🔷 [ABAP_PROJECT_RULES.md](ABAP_PROJECT_RULES.md) — Development Specifications
- Basic principles (5 items)
- Code specifications (6 items)
- ABAP constraints (7 items)
- Modification strategy (5 items)
- Testing requirements (4 items)
- AI behavior requirements (5 items)
### 🔷 [CHANGE_WORKFLOW.md](CHANGE_WORKFLOW.md) — Change Process
- Standard process (6 steps)
- Content to be output before modification
- 4 principles during modification
- Content to be output after modification
- High-risk operation review
### 🔷 [TEST_CHECKLIST.md](TEST_CHECKLIST.md) — Testing Checklist
- Basic inspection items
- Business inspection items
- Technical inspection items
- Regression inspection items
- Test types
- Acceptance criteria
### 🔷 [OBJECT_SCOPE.md](OBJECT_SCOPE.md) — Object Scope
- Environment description
- Allowed operation objects
- Operation constraints
- Modification principles
- Transport Request requirements
### 🔷 [ABAP_ENV.md](ABAP_ENV.md) — Environment Configuration
- SAP system information
- Access method
- Permission boundary
- Allowed scope
- Risk focus points
## 📊 SAP Environment Information
| Configuration Item | Value |
|--------|-----|
| **System Name** | S4D |
| **Client** | 151 |
| **Environment** | DEV (development) |
| **Permission Level** | FULL_WRITE |
| **Allow Creating Transport Request** | ✅ Yes |
| **Allow Activating Objects** | ✅ Yes |
| **Allow Packages** | Z*, Y*, $TMP, $ZADT_VSP |
## 🔒 Security and Risk Management
### High-Risk Operations (must be paused for confirmation)
- ❌ Modify standard objects
- ❌ Large-scale refactoring
- ❌ Modify permission logic
- ❌ Modify Transport strategy
- ❌ Modify interface contract
- ❌ Modify data model
- ❌ Modify production-related logic
### Mandatory Checks
- ✅ Syntax check (SyntaxCheck)
- ✅ ATC check (RunATCCheck)
- ✅ ABAP Unit test (RunUnitTests)
- ✅ Transport Request tracking
- ✅ Manual code review
## 💡 Workflow Example
### Scenario: Modifying an ABAP Report
```
1. Understand requirements
└─ User proposes requirements: add a filter field to the report
2. Analyze related objects
└─ Use /read-abap to read report source code and all includes
└─ Understand data logic, screen process, output format
3. Output plan (no direct modification)
└─ Use /plan-change to formulate change plan
└─ Explain goals, affected objects, risk points, verification methods
4. Confirm plan
└─ User confirms plan acceptability
5. Execute minimal change
└─ Create Transport Request
└─ Modify using EditSource/WriteSource
└─ Execute SyntaxCheck
6. Generate test
└─ Use /generate-unit-tests to generate ABAP Unit test
└─ Execute RunUnitTests for verification
7. Manual review
└─ Use /review-change for strict code review
└─ Manual testing of report functionality
8. Submit
└─ Activate object (Activate)
└─ Submit Transport Request
└─ Output modification summary
```
## 🛠️ Common Commands
### MCP Tool Invocation
```
Search object: SearchObject(pattern="ZCL_*", type="CLAS")
Read source code: GetSource(object_type="PROG", name="ZLMW_REPORT")
Edit code: EditSource(object_type="CLAS", name="ZCL_LMW", find="...", replace="...")
Syntax check: SyntaxCheck(object_type="PROG", name="ZLMW_REPORT")
Activate object: Activate(object_type="CLAS", name="ZCL_LMW")
Run test: RunUnitTests(test_class="ZCL_LMW_TEST", coverage=true)
```
### Slash Commands
```
/read-abap # Read current object
/plan-change # Plan change
/review-change # Code review
/generate-unit-tests # Generate test
/analyze-dump # Analyze exception
```
## 📌 Important Notes
⚠️ **Before starting, please:**
1. **Read CLAUDE.md carefully** — understand Claude's working rules in this project
2. **Understand include processing rules** — must fully expand include tree before analysis
3. **Follow change process** — plan, confirm, modify, test
4. **Configure SAP connection** — fill in real `.env` and `.mcp.json` information
5. **Enable MCP service** — correctly configure MCP server in Claude Code
6. **Track Transport Requests** — all changes must be bound to request numbers
## 🤝 Workflow Best Practices
### ✅ Things to do
- Plan and confirm before each modification
- Fully expand ABAP include tree before analysis
- Prioritize minimal change, avoid scope expansion
- Bind all changes to Transport Request
- Generate or supplement ABAP Unit tests
- Perform strict manual code review
- Record modification content, impact scope, verification steps
### ❌ Things not to do
- Fabricate SAP objects, table names, field names
- Only look at main program and conclude (must expand includes)
- Refactor unrelated code casually
- Expand change scope arbitrarily
- Modify unconfirmed objects
- Skip Transport Request tracking
- Ignore high-risk operation review confirmation
## 📞 Troubleshooting
### MCP Connection Failure
```
Error: MCP service startup failed
Reason: .env or .mcp.json configuration incorrect
Solution: Check if SAP_URL, SAP_USER, SAP_PASSWORD are correctly filled
```
### ABAP Object Not Found
```
Error: SearchObject returns empty result
Reason: Object does not exist or name is incorrect
Solution: Confirm object name using SAP system transaction SE80
```
### Activation Failure
```
Error: Activate returns error
Reason: Possible syntax error or dependency issue
Solution: Execute SyntaxCheck, then check object dependencies
```
## 📚 Related Resources
- [SAP ABAP Official Documentation](https://help.sap.com/docs/SAP_S4HANA_CLOUD/0f69f8fb28ac4bef9dbc2b1b7e46109b/8b6cbbf3f9294f27816a8c8b4c3ff14d.html)
- [ABAP Best Practices](https://www.sap.com/about/legal/copyrights/index.epx)
- [MCP Protocol Specification](https://modelcontextprotocol.io/)
- [Claude Code Official Documentation](https://claude.ai/code)
## 📄 License
This project is licensed under the MIT License. See [LICENSE](LICENSE) file.
## 👤 Author
**liumaowen**
- GitHub: [@liumaowen](https://github.com/liumaowen)
- Project: [liumaowen/ABAP](https://github.com/liumaowen/ABAP)
## 🎓 Learning Resources
- **ABAP Language**: understand basic syntax, internal table operations, database access
- **SAP System**: understand SAP ERP business process, module architecture, permission system
- **MCP Protocol**: learn MCP tool definition, parameter passing, error handling
- **Code Review**: master code review points, performance optimization, security audit
## 🔄 Update Log
### v1.0.0 (2026-04-30)
- ✅ Initialize project
- ✅ Complete all rule documents
- ✅ Configure MCP environment
- ✅ Add example configuration files
---
**Enjoy using! If you have any issues, feel free to raise an issue or PR.**
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available