
sap-abap
Comprehensive ABAP development skill for SAP systems. Use when writing ABAP code, working with internal tables, structures, ABAP SQL, object-oriented programming, RAP (RESTful Application Programming Model), CDS views, EML statements, ABAP Cloud development, string processing, dynamic programming, RTTI/RTTC, field symbols, data references, exception handling, or ABAP unit testing. Covers both classic ABAP and modern ABAP for Cloud Development patterns.
- Installs
- 1.3K
- Last 24h
- +12
- Trending rank
- #7878
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/secondsky/sap-skills --skill sap-abap- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads sap-abap automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
SAP ABAP Development Skill
Related Skills
- sap-abap-cds: Use when developing CDS views for ABAP-backed Fiori applications or defining data models with annotations
- sap-btp-cloud-platform: Use when working with ABAP Environment on BTP or deploying ABAP applications to the cloud
- sap-cap-capire: Use when connecting ABAP systems with CAP applications or integrating with OData services
- sap-fiori-tools: Use when building Fiori applications with ABAP backends or consuming OData services from ABAP systems
- sap-api-style: Use when documenting ABAP APIs or following SAP API documentation standards
When to Use This Skill
Use this skill when writing or reviewing ABAP code, modernizing classic ABAP to ABAP Cloud-compatible patterns, working with RAP or EML, implementing ABAP SQL, designing unit tests, or troubleshooting language/runtime behavior across supported ABAP releases.
Version Compatibility
This skill covers ABAP syntax from 7.40 SP08 through ABAP Cloud. Features requiring
a higher release are annotated with inline comments in code examples using the format
" [7.xx+] or noted in reference files. The table below summarizes the key version boundaries.
| Feature | 7.40 SP02 | 7.40 SP05 | 7.40 SP08 | 7.50 | 7.51 | 7.52 | 7.54 |
|---|---|---|---|---|---|---|---|
Inline declarations DATA(...) | x | x | x | x | x | x | x |
| Constructor operators (VALUE, NEW, CONV, COND, SWITCH, REF, EXACT, CAST) | x | x | x | x | x | x | x |
Table expressions itab[...] | x | x | x | x | x | x | x |
| String templates | x | x | x | x | x | x | x |
WITH EMPTY KEY | x | x | x | x | x | x | x |
line_exists(), line_index() | x | x | x | x | x | x | x |
ABAP SQL: @ host variables | x | x | x | x | x | x | |
| ABAP SQL: comma-separated lists | x | x | x | x | x | x | |
| ABAP SQL: SQL expressions in SELECT | x | x | x | x | x | x | |
CORRESPONDING operator | x | x | x | x | x | x | |
Table comprehensions (FOR) | x | x | x | x | x | x | |
LET expressions | x | x | x | x | x | x | |
REDUCE operator | x | x | x | x | x | ||
FILTER operator | x | x | x | x | x | ||
BASE addition | x | x | x | x | x | ||
LOOP AT ... GROUP BY | x | x | x | x | x | ||
ABAP SQL: dbtab~* in SELECT | x | x | x | x | x | ||
ABAP SQL: RIGHT OUTER JOIN | x | x | x | x | x | x | |
| CDS views with parameters | x | x | x | x | x | ||
FINAL(...) inline declaration | x | x | x | x | |||
Host expressions @( expr ) | x | x | x | x | |||
UNION in SELECT | x | x | x | x | |||
IS INSTANCE OF / CASE TYPE OF | x | x | x | x | |||
int8 type | x | x | x | x | |||
| CDS table functions | x | x | x | x | |||
| CDS access control (implicit) | x | x | x | x | |||
$session.user/client/system_language | x | x | x | x | |||
Test seams (TEST-SEAM) | x | x | x | x | |||
Common Table Expressions (WITH) | x | x | x | ||||
OFFSET in SELECT | x | x | x | ||||
UPPER/LOWER in CDS | x | x | x | ||||
| Enumerated types | x | x | x | ||||
Internal tables as data source FROM @itab | x | x | |||||
WITH PRIVILEGED ACCESS | x | x | |||||
utclong type and functions | x |
On a 7.40 system: Replace any FINAL(...) with DATA(...), and avoid 7.50+ features
marked in bold above. Most modern ABAP syntax (VALUE, NEW, CONV, inline declarations,
table expressions, REDUCE, FILTER, GROUP BY) is available since 7.40 SP08.
Table of Contents
- Version Compatibility
- Quick Reference
- Bundled Resources
- Common Patterns
- Error Catalog
- Performance Tips
- Source Documentation
Quick Reference
Data Types and Declarations
" Elementary types
DATA num TYPE i VALUE 123.
DATA txt TYPE string VALUE `Hello`.
DATA flag TYPE abap_bool VALUE abap_true.
" Inline declarations
DATA(result) = some_method( ).
FINAL(immutable) = `constant value`. " [7.50+] Use DATA(...) on 7.40
" Structures
DATA: BEGIN OF struc,
id TYPE i,
name TYPE string,
END OF struc.
" Internal tables
DATA itab TYPE TABLE OF string WITH EMPTY KEY.
DATA sorted_tab TYPE SORTED TABLE OF struct WITH UNIQUE KEY id.
DATA hashed_tab TYPE HASHED TABLE OF struct WITH UNIQUE KEY id.
Internal Tables - Essential Operations
" Create with VALUE
itab = VALUE #( ( col1 = 1 col2 = `a` )
( col1 = 2 col2 = `b` ) ).
" Read operations
DATA(line) = itab[ 1 ]. " By index
DATA(line2) = itab[ col1 = 1 ]. " By key
READ TABLE itab INTO wa INDEX 1.
READ TABLE itab ASSIGNING FIELD-SYMBOL(<fs>) WITH KEY col1 = 1.
" Modify operations
MODIFY TABLE itab FROM VALUE #( col1 = 1 col2 = `updated` ).
itab[ 1 ]-col2 = `changed`.
" Loop processing
LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>).
<line>-col2 = to_upper( <line>-col2 ).
ENDLOOP.
" Delete
DELETE itab WHERE col1 > 5.
DELETE TABLE itab FROM VALUE #( col1 = 1 ).
ABAP SQL Essentials
" SELECT into table
SELECT * FROM dbtab INTO TABLE @DATA(result_tab). " @ syntax: 7.40 SP05+
" SELECT with conditions
SELECT carrid, connid, fldate " comma syntax: 7.40 SP05+
FROM zdemo_abap_fli
WHERE carrid = 'LH'
INTO TABLE @DATA(flights).
" Aggregate functions
SELECT carrid, COUNT(*) AS cnt, AVG( price ) AS avg_price
FROM zdemo_abap_fli
GROUP BY carrid
INTO TABLE @DATA(stats).
" JOIN operations
SELECT a~carrid, a~connid, b~carrname
FROM zdemo_abap_fli AS a
INNER JOIN zdemo_abap_carr AS b ON a~carrid = b~carrid
INTO TABLE @DATA(joined).
" Modification statements
INSERT dbtab FROM @struc.
UPDATE dbtab FROM @struc.
MODIFY dbtab FROM TABLE @itab.
DELETE FROM dbtab WHERE condition.
Constructor Expressions
" VALUE - structures and tables
DATA(struc) = VALUE struct_type( comp1 = 1 comp2 = `text` ).
DATA(itab) = VALUE itab_type( ( a = 1 ) ( a = 2 ) ( a = 3 ) ).
" NEW - create instances
DATA(dref) = NEW i( 123 ).
DATA(oref) = NEW zcl_my_class( param = value ).
" CORRESPONDING - structure/table mapping
target = CORRESPONDING #( source ).
target = CORRESPONDING #( source MAPPING target_field = source_field ).
" COND/SWITCH - conditional values
DATA(text) = COND string( WHEN flag = abap_true THEN `Yes` ELSE `No` ).
DATA(result) = SWITCH #( code WHEN 1 THEN `A` WHEN 2 THEN `B` ELSE `X` ).
" CONV - type conversion
DATA(dec) = CONV decfloat34( 1 / 3 ).
" FILTER - table filtering
DATA(filtered) = FILTER #( itab WHERE status = 'A' ).
" REDUCE - aggregation
DATA(sum) = REDUCE i( INIT s = 0 FOR wa IN itab NEXT s = s + wa-amount ).
Object-Oriented ABAP
" Class definition
CLASS zcl_example DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor IMPORTING iv_name TYPE string.
METHODS get_name RETURNING VALUE(rv_name) TYPE string.
CLASS-METHODS factory RETURNING VALUE(ro_instance) TYPE REF TO zcl_example.
PRIVATE SECTION.
DATA mv_name TYPE string.
ENDCLASS.
CLASS zcl_example IMPLEMENTATION.
METHOD constructor.
mv_name = iv_name.
ENDMETHOD.
METHOD get_name.
rv_name = mv_name.
ENDMETHOD.
METHOD factory.
ro_instance = NEW #( `Default` ).
ENDMETHOD.
ENDCLASS.
" Interface implementation
CLASS zcl_impl DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES zif_my_interface.
ENDCLASS.
Exception Handling
TRY.
DATA(result) = risky_operation( ).
CATCH cx_sy_zerodivide INTO DATA(exc).
DATA(msg) = exc->get_text( ).
CATCH cx_root INTO DATA(any_exc).
" Handle any exception
CLEANUP.
" Cleanup code
ENDTRY.
" Raising exceptions
RAISE EXCEPTION TYPE zcx_my_exception
EXPORTING textid = zcx_my_exception=>error_occurred.
" With COND/SWITCH
DATA(val) = COND #( WHEN valid THEN result
ELSE THROW zcx_my_exception( ) ).
String Processing
" Concatenation
DATA(full) = first && ` ` && last.
txt &&= ` appended`.
" String templates
DATA(msg) = |Name: { name }, Date: { date DATE = ISO }|.
" Functions
DATA(upper) = to_upper( text ).
DATA(len) = strlen( text ).
DATA(found) = find( val = text sub = `search` ).
DATA(replaced) = replace( val = text sub = `old` with = `new` occ = 0 ).
DATA(parts) = segment( val = text index = 2 sep = `,` ).
" FIND/REPLACE statements
FIND ALL OCCURRENCES OF pattern IN text RESULTS DATA(matches).
REPLACE ALL OCCURRENCES OF old IN text WITH new.
Dynamic Programming
" Field symbols
FIELD-SYMBOLS <fs> TYPE any.
ASSIGN struct-component TO <fs>.
ASSIGN struct-(comp_name) TO <fs>. " Dynamic component
" Data references
DATA dref TYPE REF TO data.
dref = REF #( variable ).
CREATE DATA dref TYPE (type_name).
dref->* = value.
" RTTI - Get type information
DATA(tdo) = cl_abap_typedescr=>describe_by_data( dobj ).
DATA(components) = CAST cl_abap_structdescr( tdo )->components.
" RTTC - Create types dynamically
DATA(elem_type) = cl_abap_elemdescr=>get_string( ).
CREATE DATA dref TYPE HANDLE elem_type.
Bundled Resources
This skill includes 28 comprehensive reference files covering all aspects of ABAP development:
Related Skills
- sap-abap-cds: For CDS view development and ABAP Cloud data modeling
- sap-btp-cloud-platform: For ABAP Environment setup and BTP deployment
- sap-cap-capire: For CAP service integration and ABAP system connections
- sap-fiori-tools: For Fiori application development with ABAP backends
- sap-api-style: For API documentation standards and best practices
Quick Access
- Reference Guide:
references/skill-reference-guide.md- Complete guide to all reference files - Internal Tables:
references/internal-tables.md- Complete table operations - ABAP SQL:
references/abap-sql.md- Comprehensive SQL reference - Object Orientation:
references/object-orientation.md- Classes and interfaces
Development Topics
references/constructor-expressions.md- VALUE, NEW, COND, REDUCEreferences/rap-eml.md- RAP and EML operationsreferences/cds-views.md- CDS view developmentreferences/string-processing.md- String functions and regexreferences/unit-testing.md- ABAP Unit frameworkreferences/performance.md- Optimization techniques- ... and 18 more specialized references
Common Patterns
Safe Table Access (Avoid Exceptions)
" Using VALUE with OPTIONAL
DATA(line) = VALUE #( itab[ key = value ] OPTIONAL ).
" Using VALUE with DEFAULT
DATA(line) = VALUE #( itab[ 1 ] DEFAULT VALUE #( ) ).
" Check before access
IF line_exists( itab[ key = value ] ).
DATA(line) = itab[ key = value ].
ENDIF.
Functional Method Chaining
DATA(result) = NEW zcl_builder( )
->set_name( `Test` )
->set_value( 123 )
->build( ).
FOR Iteration Expressions
" Transform table
DATA(transformed) = VALUE itab_type(
FOR wa IN source_itab
( id = wa-id name = to_upper( wa-name ) ) ).
" With WHERE
DATA(filtered) = VALUE itab_type(
FOR wa IN source WHERE ( status = 'A' )
( wa ) ).
" With INDEX INTO
DATA(numbered) = VALUE itab_type(
FOR wa IN source INDEX INTO idx
( line_no = idx data = wa ) ).
ABAP Cloud Compatibility
" Use released APIs only
DATA(uuid) = cl_system_uuid=>create_uuid_x16_static( ).
DATA(date) = xco_cp=>sy->date( )->as( xco_cp_time=>format->iso_8601_extended )->value.
DATA(time) = xco_cp=>sy->time( )->as( xco_cp_time=>format->iso_8601_extended )->value.
" Output in cloud (if_oo_adt_classrun)
out->write( result ).
" Avoid: sy-datum, sy-uzeit, DESCRIBE TABLE, WRITE, MOVE...TO
ABAP 7.40 Compatibility
When targeting ABAP 7.40 systems, replace 7.50+ syntax with these patterns:
" Instead of FINAL (7.50+):
FINAL(value) = `constant`. " 7.50+
DATA(value) = `constant`. " 7.40 compatible
" Instead of host expressions (7.50+):
SELECT * FROM dbtab WHERE col = @( lv_val ). " 7.50+
SELECT * FROM dbtab WHERE col = @lv_val. " 7.40 compatible
" Instead of UNION (7.50+):
SELECT a FROM tab1 UNION SELECT a FROM tab2. " 7.50+
" Use two separate SELECTs on 7.40 and combine in ABAP:
SELECT a FROM tab1 INTO TABLE @DATA(r1).
SELECT a FROM tab2 INTO TABLE @DATA(r2).
DATA(combined) = VALUE itab_type( FOR l1 IN r1 ( l1 )
FOR l2 IN r2 ( l2 ) ).
" Instead of IS INSTANCE OF (7.50+):
IF oref IS INSTANCE OF zcl_my_class. " 7.50+
" 7.40 alternative — use typed CAST with exception handling:
TRY.
DATA(lo) = CAST zcl_my_class( oref ). " 7.40+
CATCH cx_sy_move_cast_error.
" oref is not compatible with zcl_my_class
ENDTRY.
" Instead of CTEs WITH (7.51+):
WITH +cte AS ( SELECT ... ) SELECT ... " 7.51+
" Use subqueries or temporary tables on 7.40
Error Catalog
CX_SY_ITAB_LINE_NOT_FOUND
Cause: Table expression access to non-existent line
Solution: Use OPTIONAL, DEFAULT, or check with line_exists( )
CX_SY_ZERODIVIDE
Cause: Division by zero Solution: Check divisor before operation
CX_SY_RANGE_OUT_OF_BOUNDS
Cause: Invalid substring access or array bounds Solution: Validate offset and length before access
CX_SY_CONVERSION_NO_NUMBER
Cause: String cannot be converted to number Solution: Validate input format before conversion
CX_SY_REF_IS_INITIAL
Cause: Dereferencing unbound reference
Solution: Check IS BOUND before dereferencing
Performance Tips
- Use SORTED/HASHED tables for frequent key access
- Prefer field symbols over work areas in loops for modification
- Use PACKAGE SIZE for large SELECT results
- Avoid SELECT in loops - use FOR ALL ENTRIES or JOINs
- Use secondary keys for different access patterns
- Minimize CORRESPONDING calls - explicit assignments are faster
Source Documentation
All content based on SAP official ABAP Cheat Sheets:
- Repository: https://github.com/SAP-samples/abap-cheat-sheets
- SAP Help (latest): https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm
- SAP Help (7.40): https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/index.htm
- ABAP Release News: https://github.com/SAP-samples/abap-cheat-sheets/blob/main/33_ABAP_Release_News.md
FAQ
What does the sap-abap skill do?
Comprehensive ABAP development skill for SAP systems. Use when writing ABAP code, working with internal tables, structures, ABAP SQL, object-oriented programming, RAP (RESTful Application Programming Model), CDS views, EML statements, ABAP Cloud development, string processing, dynamic programming, RTTI/RTTC, field symbols, data references, exception handling, or ABAP unit testing. Covers both classic ABAP and modern ABAP for Cloud Development patterns.
How do I install sap-abap?
Run npx skills add https://github.com/secondsky/sap-skills --skill sap-abap in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sap-abap/ (personal) or .claude/skills/sap-abap/ (project).
Which AI agents can use sap-abap?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is sap-abap safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains sap-abap?
It is published by secondsky in secondsky/sap-skills. It has 1,269 recorded installs.
More from secondsky/sap-skills
sap-fiori-tools
secondsky/sap-skills
Develops SAP Fiori applications using SAP Fiori tools extensions for VS Code and SAP Business Application Studio. Use when: generating Fiori Elements or Freestyle SAPUI5 applications, configuring Page Editor for List Report or Object Page, working with annotations and Service Modeler, setting up deployment to ABAP or Cloud Foundry, creating adaptation projects, using Guided Development, previewing with mock data or live data, configuring SAP Fiori launchpad, or using AI-powered generation with Project Accelerator/Joule. Technologies: SAP Fiori Elements, SAPUI5, OData V2/V4, CAP, SAP BTP, ABAP, Cloud Foundry, fiori-mcp-server (MCP tools for AI-assisted generation).
sap-cap-capire
secondsky/sap-skills
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, multitenancy, or messaging. Covers CDL/CQL/CSN syntax, Node.js and Java runtimes, event handlers, OData services, and CAP plugins.
sap-btp-developer-guide
secondsky/sap-skills
Develops business applications on SAP Business Technology Platform (BTP) using CAP (Node.js/Java) or ABAP Cloud. Use when: building cloud applications on SAP BTP, deploying to Cloud Foundry or Kyma runtimes, integrating with SAP HANA Cloud, implementing SAP Fiori UIs, connecting to remote SAP systems, building multitenant SaaS applications, extending SAP S/4HANA or SuccessFactors, setting up CI/CD pipelines, implementing observability, or following SAP development best practices. Keywords: SAP BTP, Business Technology Platform, CAP, Cloud Application Programming Model, ABAP Cloud, Cloud Foundry, Kyma, SAP HANA Cloud, SAP Fiori, SAPUI5, CI/CD, observability, multitenant, SaaS, SAP BTP ABAP environment, SAP Business Application Studio, SAP Cloud SDK, SAP Integration Suite, SAP Event Mesh, SAP Connectivity Service, SAP Destination Service, XSUAA, OAuth, OpenID Connect, OData, CDS, Core Data Services, ABAP CDS, ABAP RESTful Application Programming Model, RAP, ABAP development, SAP BTP deve
sap-btp-best-practices
secondsky/sap-skills
SAP BTP best practices for enterprise architecture, account management, security, and operations, with verification evidence tracked in the repository ledger. Use when planning BTP implementations, setting up account hierarchies, configuring environments, implementing authentication, designing CI/CD pipelines, establishing governance, building Platform Engineering teams, implementing failover strategies, or managing application lifecycle on SAP BTP. Keywords: SAP BTP, account hierarchy, global account, directory, subaccount, Cloud Foundry, Kyma, ABAP, SAP Identity Authentication, CI/CD, governance, Platform Engineering, failover, multi-region, SAP BTP best practices
sap-btp-connectivity
secondsky/sap-skills
SAP BTP Connectivity skill covering Destination Service, Connectivity Service, Cloud Connector, Connectivity Proxy, and Transparent Proxy for Kubernetes. Use when configuring destinations (HTTP, RFC, LDAP, MAIL, TCP), setting up cloud-to-on-premise connectivity, implementing OAuth and principal propagation, deploying connectivity proxies in Kubernetes/Kyma, troubleshooting connectivity errors (405, 407, 503), or configuring multitenancy.
sap-abap-cds
secondsky/sap-skills
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 expressions, implementing access control with DCL, handling CURR/QUAN data types, troubleshooting CDS errors, querying CDS views from ABAP, or displaying data with SALV IDA. Covers ABAP 7.4+ through ABAP Cloud.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.