abap-sql-amdp

abap-sql-amdp is a skill for Claude Code from likweitan/abap-skills. It costs 201 tokens per session (2,447 once invoked), scanned A, original, MIT.

Guidance for writing modern ABAP SQL and AMDP, which lets ABAP code run database procedures on SAP HANA. It covers queries, calculations, common table expressions, window functions, and database-backed functions.

In plain words
What is it for?
Use it to write or improve ABAP SQL queries, create AMDP procedures or functions, build CDS table functions, and investigate database performance.
Why use it?
It helps developers select suitable database features while accounting for the differences between ABAP Cloud and traditional ABAP.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sap-abap plugin — 18 skills shipped together

Good fit Use it to write or improve ABAP SQL queries, create AMDP procedures or functions, build CDS table functions, and investigate database performance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/likweitan/abap-skills/abap-sql-amdp
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.

Any agent
npx skills add likweitan/abap-skills --skill abap-sql-amdp
Clone the repo
git clone --depth 1 https://github.com/likweitan/abap-skills

Made for: Claude Code.

Or install sap-abap, the plugin that ships this one along with the rest of its 18 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for abap-sql-amdp

README.md
[![agentmods](https://agentmods.dev/badge/skills/likweitan/abap-skills/abap-sql-amdp/github.svg)](https://agentmods.dev/skills/likweitan/abap-skills/abap-sql-amdp)
Your own site
<a href="https://agentmods.dev/skills/likweitan/abap-skills/abap-sql-amdp"><img src="https://agentmods.dev/badge/skills/likweitan/abap-skills/abap-sql-amdp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for abap-sql-amdp

Your own site · 80×15
<a href="https://agentmods.dev/skills/likweitan/abap-skills/abap-sql-amdp"><img src="https://agentmods.dev/badge/skills/likweitan/abap-skills/abap-sql-amdp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 201 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,447 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 162
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
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.1 $0.00201 $0.02447
Opus 5 $0.00101 $0.01223
Sonnet 5 $0.00040 $0.00489
Haiku 4.5 $0.00020 $0.00245

Measured 10d ago against content hash 2c7c965559d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

abap-sql-amdp 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 10d ago.

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.

skills/abap-sql-amdp/SKILL.md · 309 lines

How it starts

The opening of the file, as written. The whole thing — 309 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ABAP SQL & AMDP

Guide for writing modern ABAP SQL statements and ABAP Managed Database Procedures (AMDP) in ABAP Cloud and Standard ABAP.

Workflow

  1. Determine the user's goal:

    • Writing or optimizing ABAP SQL queries
    • Using advanced SQL features (window functions, CTEs, aggregates)
    • Creating AMDP procedures or functions
    • Implementing CDS table functions via AMDP
    • Understanding PRIVILEGED ACCESS for authorization bypass
  2. Identify the context:

    • ABAP for Cloud Development vs. Standard ABAP (affects available syntax)
    • Performance optimization needs
    • Whether AMDP is justified (prefer ABAP SQL when possible)
  3. Guide implementation using modern ABAP SQL syntax

Modern ABAP SQL Quick Reference

Basic SELECT with Inline Declaration

"Single record
SELECT SINGLE FROM ztravel
  FIELDS travel_id, description, total_price, currency_code
  WHERE travel_id = @lv_travel_id
  INTO @DATA(ls_travel).

"Multiple records into internal table
SELECT FROM ztravel
  FIELDS travel_id, description, total_price, currency_code
  WHERE status = 'O'
  ORDER BY total_price DESCENDING
  INTO TABLE @DATA(lt_travels)
  UP TO 100 ROWS.

Expressions in SELECT List

SELECT FROM zflight
  FIELDS carrier_id,
         connection_id,
         flight_date,
         seats_max - seats_occupied AS seats_free,
         CASE WHEN seats_occupied > seats_max * 80 / 100
              THEN 'FULL'
              ELSE 'AVAILABLE'
         END AS availability,
         CAST( price AS DECFLOAT34 ) AS price_dec,
         CONCAT( carrier_id, connection_id ) AS flight_key
  INTO TABLE @DATA(lt_flights).

Aggregate Functions and GROUP BY

SELECT FROM zflight
  FIELDS carrier_id,
         COUNT(*) AS flight_count,
         SUM( seats_occupied ) AS total_passengers,
         AVG( price ) AS avg_price,
         MIN( flight_date ) AS first_flight,
         MAX( flight_date ) AS last_flight
  GROUP BY carrier_id
  HAVING COUNT(*) > 10
  INTO TABLE @DATA(lt_stats).

Read the full file on GitHub · 309 lines

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. 10d ago First seen · 309 lines · 201 tokens per session scan A 2c7c965559d7

Subscribe to this mod's changes

abap-sql-amdp is a skill published in the GitHub repository likweitan/abap-skills (60 stars, last pushed 14d ago), licensed MIT. It adds 201 tokens to every session and 2,447 once invoked, about $0.0010 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 skills, from other repositories

sap-abap-cds

Comprehensive SAP ABAP CDS (Core Data Services) reference for data modeling, view development, and semantic enrichment. Use when creating CDS views or view entities, defining data models with annotations, working with associations and cardinality, implementing input parameters, using built-in functions, writing CASE…

secondsky/sap-skills · 113 tokens

sap-cap-capire

SAP Cloud Application Programming Model (CAP) development skill using Capire documentation. Use when: building CAP applications, defining CDS models, implementing services, working with SAP HANA/SQLite/PostgreSQL databases, deploying to SAP BTP Cloud Foundry or Kyma, implementing Fiori UIs, handling authorization…

secondsky/sap-skills · 103 tokens

sap-sqlscript

This skill should be used when the user asks to "write a SQLScript procedure", "create HANA stored procedure", "implement AMDP method", "optimize SQLScript performance", "handle SQLScript exceptions", "debug HANA procedure", "create table function", "inspect a browser-based Datasphere SQL editor with Microsoft Edge…

secondsky/sap-skills · 138 tokens

sap-hana-cli

Assists with SAP HANA Developer CLI (hana-cli) for database development and administration. Use when: installing hana-cli, connecting to SAP HANA databases, inspecting database objects (tables, views, procedures, functions), managing HDI containers, executing SQL queries, converting metadata to CDS/EDMX/OpenAPI…

secondsky/sap-skills · 112 tokens

sap-background-jobs

Investigate SAP background jobs, including failed or aborted jobs, job status, job steps, job logs, runtime dumps, TBTCO, TBTCP, and TBTCJOBLOG0-9.

marcellourbani/vscode_abap_remote_fs · 46 tokens

abap-performance-hana

ABAP performance best practices for S/4HANA and HANA database systems.Use when writing or reviewing ABAP code on HANA-based systems.IMPORTANT: First use the SAP system info tool to check the system type — if the system is ECC or runs on a traditional database (Oracle, DB2, MSSQL), load the abap-performance-ecc skill…

marcellourbani/vscode_abap_remote_fs · 0 tokens