sapstack abap.instructions.md

A set of rules for writing ABAP, SAP's programming language, with guidance for database access, S/4HANA compatibility, error handling, security, and extensions.

In plain words
What is it for?
Use it when developing or reviewing ABAP programs, BAPIs, CDS views, RAP actions, BAdIs, and related SAP integrations.
Why use it?
It helps avoid slow queries, outdated data access, unsafe changes to standard SAP objects, missing error checks, hardcoded business values, and exposed personal data.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/boxlogodev/sapstack/abap
Clone the repo
git clone --depth 1 https://github.com/BoxLogoDev/sapstack

Made for: GitHub Copilot.

Per session 571 This file is loaded in full into every session.
When invoked 571 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00571 $0.00571
Opus 5 $0.00285 $0.00285
Sonnet 5 $0.00114 $0.00114
Haiku 4.5 $0.00057 $0.00057

Measured yesterday against content hash cfb53f88d0d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sapstack abap.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/abap.instructions.md · 58 lines

What it actually says

ABAP Instructions (GitHub Copilot)

이 파일은 ABAP 파일을 편집할 때만 적용되는 Copilot 지침입니다.

기본 규칙 (Clean Core + HANA + K-SOX)

SELECT 최적화

  • SELECT * FROM ... — 금지
  • ✅ 필요 필드만 SELECT + WHERE 조건 (PK/인덱스)
  • LOOP AT ... SELECT ... (N+1 문제) — 금지
  • ✅ FOR ALL ENTRIES (empty check 포함) 또는 JOIN

S/4HANA 대응

  • BSEG → I_JournalEntryItem CDS 사용
  • MKPF/MSEG → I_MaterialDocumentItem CDS
  • KNA1/LFA1 직접 접근 금지 → Business Partner 사용
  • CALL TRANSACTION 백그라운드에서 금지 → BAPI / RAP action

에러 처리

  • 모든 BAPI 호출은 RETURN 테이블에서 type = 'E' 또는 'A' 체크
  • 오류 시 BAPI_TRANSACTION_COMMIT 호출 금지
  • 오브젝트 참조 메서드 호출 전 IS BOUND 체크
  • TRY-CATCH는 위험한 작업(파일 I/O, 동적 변환, 외부 호출)에만

Clean Core

  • 표준 SAP 오브젝트 직접 수정 금지 (BAdI / Enhancement Spot / CDS 확장 사용)
  • Access Key 사용 = 위험 신호
  • Z-프로그램은 반드시 Z*/Y* 접두어

보안

  • 민감 데이터 접근 전 AUTHORITY-CHECK
  • 하드코딩된 비밀번호·API 키 금지
  • 한국 개인정보(주민번호, 연락처)는 로그 출력·UI 표시에서 마스킹 필수

하드코딩 금지

  • 회사코드, G/L 계정, 원가센터, 플랜트 등 고정값 금지
  • TVARV / Z-테이블 / DDIC Domain / .sapstack/config.yaml 활용

권장 패턴 예시

자세한 코드 예시는 plugins/sap-abap/skills/sap-abap/SKILL.md의 "Section 3 — Code Patterns with Full Examples"를 참조하세요:

  • New BAdI
  • ALV OO 방식
  • BAPI 에러 처리
  • CDS View
  • RAP Behavior Definition
  • ABAP Unit Test

성능 Quick Check

SAP Note 참조:

  • 2161145 — S/4HANA SQL Optimization Guidelines
  • 2313884 — Custom Code Migration Tool (ATC)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 58 lines · 571 tokens per session scan A cfb53f88d0d8

Subscribe to this mod's changes

sapstack abap.instructions.md is an instructions file published in the GitHub repository BoxLogoDev/sapstack (18 stars, last pushed 2d ago), licensed MIT. It adds 571 tokens to every session, about $0.0029 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

abap2UI5 AGENTS.md

Instructions for abap2UI5/abap2UI5, covering agents.md — ai assistant guide for abap2ui5, where knowledge lives, project overview, related repositories and architecture.

abap2UI5/abap2UI5 · 28,164 tokens

vibing-steampunk copilot-instructions.md

Instructions for oisee/vibing-steampunk, covering copilot instructions for vsp, project, build, test, lint, build and run all unit tests.

oisee/vibing-steampunk · 1,439 tokens

onebase CLAUDE.md

Instructions for ivanarama/onebase, covering claude.md, сборка и запуск, cli + сервер (без cgo) — основной бинарь, gui с нативным окном (cgo + webview2 на windows) and тесты.

ivanarama/onebase · 5,591 tokens

mcp-erpnext AGENTS.md

Instructions for Casys-AI/mcp-erpnext, covering agents.md, project overview, project structure & module organization, build, test, and development commands and run all tests (also: deno task test).

Casys-AI/mcp-erpnext · 6,458 tokens

abap2UI5 CLAUDE.md

Instructions for abap2UI5/abap2UI5: All project guidance lives in AGENTS.md — the single source of truth for this repository (architecture and the layered design, the src/00-99 packages, the generated app/webapp mirror, the build and delivery pipeline, the CI gates and ABAP code style).

abap2UI5/abap2UI5 · 79 tokens

balaka CLAUDE.md

Instructions for artivisi/balaka, covering claude instructions, project overview, current status, key files and development guidelines.

artivisi/balaka · 3,438 tokens