Guides writing modern ABAP SQL and AMDP (ABAP Managed Database Procedures) including inline declarations, window functions, CTEs, aggregates, PRIVILEGED ACCESS, and CDS table functions.
Ships in SAP ABAP. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide for writing modern ABAP SQL statements and ABAP Managed Database Procedures (AMDP) in ABAP Cloud and Standard ABAP.
Clean core context:
SELECTfrom a released CDS view is Level A. Direct read access to an SAP database table is Level C (ATC priority 2); direct write access is Level D (ATC priority 1).EXEC SQL(native SQL) is a critical statement → Level D.SYCM_USAGE_OF_APISreports SQL statements on SAP database tables and views. See theabap-cloudskill for level details.
Determine the user's goal:
Identify the context:
Guide implementation using modern ABAP SQL syntax
"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.
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).
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).
SELECT FROM zflight
FIELDS carrier_id,
connection_id,
flight_date,
price,
"Running total
SUM( price ) OVER( PARTITION BY carrier_id
ORDER BY flight_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS running_total,
"Row number within partition
ROW_NUMBER( ) OVER( PARTITION BY carrier_id
ORDER BY flight_date DESCENDING ) AS row_num,
"Ranking
RANK( ) OVER( PARTITION BY carrier_id ORDER BY price DESCENDING ) AS price_rank,
"Lead/Lag
LAG( price, 1 ) OVER( PARTITION BY carrier_id ORDER BY flight_date ) AS prev_price,
LEAD( price, 1 ) OVER( PARTITION BY carrier_id ORDER BY flight_date ) AS next_price
INTO TABLE @DATA(lt_window).
WITH
+connections AS (
SELECT FROM zflsch
FIELDS carrier_id, connection_id, city_from, city_to
WHERE carrier_id IN @lt_carriers ),
+flight_counts AS (
SELECT FROM zflight
FIELDS carrier_id, connection_id,
COUNT(*) AS cnt
GROUP BY carrier_id, connection_id ),
+result AS (
SELECT FROM +connections AS c
INNER JOIN +flight_counts AS f
ON c~carrier_id = f~carrier_id AND c~connection_id = f~connection_id
FIELDS c~carrier_id, c~city_from, c~city_to, f~cnt )
SELECT FROM +result
FIELDS *
ORDER BY cnt DESCENDING
INTO TABLE @DATA(lt_result).
"UNION ALL (keeps duplicates) / UNION (removes duplicates)
SELECT FROM ztable1 FIELDS col1, col2
UNION ALL
SELECT FROM ztable2 FIELDS col1, col2
INTO TABLE @DATA(lt_union).
"INTERSECT — rows in both
SELECT FROM ztable1 FIELDS col1
INTERSECT
SELECT FROM ztable2 FIELDS col1
INTO TABLE @DATA(lt_intersect).
"EXCEPT — rows in first but not second
SELECT FROM ztable1 FIELDS col1
EXCEPT
SELECT FROM ztable2 FIELDS col1
INTO TABLE @DATA(lt_except).
Bypasses CDS access control (DCL) entirely. Use only in trusted backend code after an independent authorization check; never rely on DCL to protect rows returned by this query. For user-facing access, prefer a DCL-protected query.
"Run only after an explicit authorization check
SELECT FROM zi_travel
FIELDS travel_id, description
WHERE status = 'O'
INTO TABLE @DATA(lt_all_travels)
PRIVILEGED ACCESS.
| Category | Functions |
|---|---|
| String | CONCAT, SUBSTRING, LENGTH, LEFT, RIGHT, LTRIM, RTRIM, UPPER, LOWER, REPLACE, LPAD, RPAD |
| Numeric | ABS, CEIL, FLOOR, ROUND, MOD, DIV, DIVISION |
| Date/Time | DATS_ADD_DAYS, DATS_DAYS_BETWEEN, TSTMP_ADD_SECONDS, TSTMP_CURRENT_UTCTIMESTAMP, DATN_ADD_MONTHS |
| Conversion | CAST, COALESCE, CURRENCY_CONVERSION, UNIT_CONVERSION |
| Null | COALESCE, CASE WHEN ... IS NULL |
| Aggregate | COUNT, SUM, AVG, MIN, MAX, STRING_AGG |
"Scalar subquery
SELECT FROM ztravel
FIELDS travel_id,
total_price,
( SELECT AVG( total_price ) FROM ztravel ) AS avg_price
INTO TABLE @DATA(lt_with_avg).
"EXISTS subquery
SELECT FROM ztravel AS t
FIELDS t~travel_id, t~description
WHERE EXISTS ( SELECT FROM zbooking AS b
WHERE b~travel_id = t~travel_id
AND b~flight_date > @sy-datum )
INTO TABLE @DATA(lt_with_bookings).
CLASS zcl_my_amdp DEFINITION
PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb. "Mandatory for AMDP
TYPES: BEGIN OF ty_result,
carrier_id TYPE s_carr_id,
total TYPE i,
END OF ty_result,
tt_result TYPE STANDARD TABLE OF ty_result WITH EMPTY KEY.
"AMDP procedure
METHODS get_carrier_stats
AMDP OPTIONS READ-ONLY CDS SESSION CLIENT DEPENDENT
EXPORTING VALUE(et_result) TYPE tt_result.
"AMDP table function for CDS table function
CLASS-METHODS get_data FOR TABLE FUNCTION zdemo_amdp_tf.
ENDCLASS.
METHOD get_carrier_stats
BY DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING zflight_ve.
et_result = SELECT carrier_id,
COUNT(*) AS total
FROM zflight_ve
GROUP BY carrier_id
ORDER BY total DESC;
ENDMETHOD.
CDS table function definition:
@ClientHandling.type: #CLIENT_DEPENDENT
@ClientHandling.algorithm: #SESSION_VARIABLE
define table function ZDEMO_AMDP_TF
with parameters @Environment.systemField: #SYSTEM_LANGUAGE p_lang : abap.lang
returns {
key carrier_id : s_carr_id;
carrier_name : s_carrname;
flight_count : abap.int4;
}
implemented by method zcl_my_amdp=>get_data;
AMDP implementation:
METHOD get_data
BY DATABASE FUNCTION
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING zcarrier_ve zflight_ve.
RETURN SELECT c.carrier_id,
c.carrier_name,
COUNT(*) AS flight_count
FROM zcarrier_ve AS c
INNER JOIN zflight_ve AS f
ON c.carrier_id = f.carrier_id
GROUP BY c.carrier_id, c.carrier_name;
ENDMETHOD.
| Addition | Use Case |
|---|---|
CDS SESSION CLIENT DEPENDENT | Uses client-dependent CDS views (most common) |
CLIENT INDEPENDENT | Uses only client-independent objects |
AMDP OPTIONS READ-ONLY | Mandatory in ABAP for Cloud Development |
When helping with ABAP SQL or AMDP topics, structure responses as:
## ABAP SQL / AMDP Guidance
### Query
[The ABAP SQL statement or AMDP implementation]
### Explanation
[Key features used and why]
### Performance Notes
[Optimization considerations if relevant]
| Scenario | Level | Notes |
|---|---|---|
SELECT from a released CDS view (I_*) | A | Target state |
SELECT from your own custom tables | A | Allowed within the same software component |
SELECT from a classic (nominated) SAP CDS view | B | Acceptable in classic ABAP development |
| Direct read from an SAP database table | C | ATC priority 2 — use a released CDS view instead |
| Direct write to an SAP database table | D | ATC priority 1 — use released or classic APIs |
EXEC SQL (native SQL) | D | Critical statement — use ABAP SQL or AMDP |
| Database hints | D | Critical statement |
| AMDP over released CDS views | A | Keep USING restricted to released entities |
| AMDP over SAP tables | C/D | Read → C, write → D |
| CDS table function via AMDP over released entities | A | Valid Level A pushdown technique |
Performance remediation: when adapting legacy code, use SQL Monitor to detect optimization candidates, then apply code pushdown with CDS, AMDP and ABAP SQL rather than reaching for native SQL or database hints.
EXEC SQL during remediationSYCM_USAGE_OF_APIS and CI_CRITICAL_STATEMENTSWhat SKILL.md sets; muted values are Claude Code's defaults
17 skills in this plugin
/abapComprehensive ABAP code quality checking using abaplint (automated static analysis) and Clean ABAP principles (manual code review). Use when users ask to check, lint, validate, review, or analyze ABAP code for syntax errors, clean code compliance, code quality, best practices, or adherence to Clean ABAP guidelines. Also use for abaplint setup, configuration, and execution. Triggers include "check this ABAP code", "lint my ABAP", "run abaplint", "configure abaplint", "is this clean ABAP", "review my ABAP", "analyze ABAP code quality", "code quality check", or "ABAP best practices"./abap-cloudHelp with ABAP Cloud development and the clean core level concept (Levels A, B, C, D) including ABAP Cloud vs. classic ABAP development models, ABAP Cloud language version restrictions, wrapper patterns for non-released APIs, released/classic/internal/not-recommended object classification, and clean core principles. Use when users ask about ABAP Cloud, ABAP for Cloud Development, clean core, clean core levels, Level A B C D, classic API, internal object, not recommended object, noAPI, wrapper pattern, released APIs, stability contract, language version, restricted ABAP, embedded Steampunk, developer extensibility, key user extensibility, changelog for SAP objects, or ABAP Cloud readiness. Triggers include "ABAP Cloud restrictions", "clean core", "clean core level", "which level is my extension", "Level A extension", "classic API", "wrapper class", "released API alternative", "ABAP language version", "Steampunk", or "extensibility model"./abap-cloud-migrationHelp with migrating classic ABAP custom code toward higher clean core levels (Level A/B/C/D) including custom code adaptation, identifying released and classic API replacements, generating wrapper classes for non-released objects, ATC clean core and Cloud Readiness checks, changelog for SAP objects, handling incompatible language constructs, and step-by-step remediation workflows. Use when users ask about migrating to ABAP Cloud, custom code migration, cloud readiness, clean core level remediation, eliminating Level D, reducing Level C, non-released API replacement, wrapper pattern, ATC clean core checks, code adaptation, classic to cloud migration, or clean core compliance. Triggers include "migrate to ABAP Cloud", "cloud readiness check", "clean core level", "eliminate Level D", "reduce Level C", "non-released API", "replace with released API", "custom code adaptation", "wrapper for non-released", "ATC clean core", "clean core migration", "changelog for SAP objects", or "ABAP Cloud compatibility"./abapgitHelp with abapGit workflows including repository setup, cloning, serialization, branching strategies, transport-vs-git workflows, CI/CD integration, and .abapgit.xml configuration. Use when users ask about abapGit, git for ABAP, ABAP version control, abapGit clone, abapGit pull, abapGit push, branching strategy for ABAP, abapGit configuration, serialization, deserialization, transport vs git, gCTS, abapGit CI/CD, or managing ABAP code in git repositories. Triggers include "set up abapGit", "clone a repo", "push ABAP to git", "abapGit branching", "abapGit configuration", ".abapgit.xml", "transport vs git", or "CI/CD for ABAP"./abap-unit-testingHelp with ABAP Unit testing including test class setup, assertions, test doubles, mocking frameworks, dependency injection, CDS test environments, SQL test environments, RAP BO test doubles, and test fixtures. Use when users ask about ABAP unit tests, test classes, test methods, CL_ABAP_UNIT_ASSERT, test doubles, mocking, CDS test environment, SQL test environment, RAP testing, ABAP test injection, test seams, behavior-driven testing, TDD in ABAP, test isolation, or writing automated tests for ABAP code. Triggers include "write a unit test", "create test class", "mock a dependency", "test a CDS view", "test a RAP BO", "test double", "assertion", "test fixture", "test isolation", or "ABAP unit"./atc-cloudificationConfigure ATC clean core and Cloud Readiness checks using the SAP Cloudification Repository, and map ATC findings to clean core levels (A, B, C, D). Use when users ask about ATC check variants for cloud readiness, clean core compliance, clean core levels, released/classic/internal/noAPI object classification, cloudification repository setup, objectReleaseInfo or objectClassifications JSON files, ATC exemptions, changelog for SAP objects, SAP Cloud ERP or SAP Cloud ERP Private API validation, or migrating custom code to ABAP Cloud. Triggers include "configure ATC cloud readiness", "set up clean core check", "cloudification repository URL", "released APIs check", "which level is this ATC finding", "ATC priority 1 clean core", "ATC exemption", "changelog for SAP objects", or "which JSON file for my S/4HANA version"./sap-abap:abap-sql-amdpfrom SAP ABAP
npx claudepluginhub likweitan/abap-skills --plugin sap-abapOther plugins' skills for the same job