rap
Skill1 starsChanged 4 months agoMITView on GitHub
Help with RAP (RESTful ABAP Programming Model) development including behavior definitions, EML statements, managed and unmanaged BOs, draft handling, actions, validations, determinations, side effects, and business events. Use when users ask about RAP, BDEF, BDL, EML, behavior definitions, behavior pools, managed BO, unmanaged BO, draft-enabled BO, RAP actions, RAP validations, RAP determinations, RAP side effects, RAP business events, create/read/update/delete in RAP, or building transactional Fiori apps with ABAP Cloud. Triggers include "create a RAP BO", "write a behavior definition", "EML syntax", "managed vs unmanaged", "enable draft", "add an action", "add a validation", "RAP handler method", or "RAP saver class".
4 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- m0NSYuke/PaperLabtheir own version, first seen Nov 8, 2026
- dovoanhtruong/abap-agent-claudecode-workspaceedited, first seen Oct 12, 2026
- wkhori/raptheir own version, first seen Sep 15, 2026
- likweitan/abap-skillsedited, first seen Jul 14, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- likweitan/abap-skills★ 7282% same
- dovoanhtruong/abap-agent-claudecode-workspace★ 360% same
Wrote their own version · 2
- m0NSYuke/PaperLab★ 4same name
- wkhori/rap★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository413 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- .cursor/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sap-router-skillCopilot instructions
- .cursor/rules/sap-router.mdcCursor rule
- abap-cloud-migrationSkill
- abap-cloudSkill
- abap-code-patternsSkill
- abap-code-reviewSkill
- abap-docs-referenceSkill
- abapgitSkill
- abapSkill
- abap-snippetSkill
- abap-sql-amdpSkill
- abap-system-infoSkill
- abap-unit-testingSkill
- arc-1-skillsSkill
- atc-cloudificationSkill
- authorization-iamSkill
- automation-pilot-catalog-explorerSkill
- automation-pilot-command-generationSkill
- automation-pilot-command-reviewSkill
- automation-pilot-content-management-via-apiSkill
- automation-pilot-debuggerSkill
- automation-pilot-executions-apiSkill
- automation-pilot-executor-executescriptSkill
- automation-pilot-executor-httprequestSkill
- automation-pilot-mcp-server-generationSkill
- automation-pilot-scheduled-executions-apiSkill
- badi-enhancementSkill
- btp-abap-environmentSkill
- btp-best-practicesSkill
- btp-build-work-zoneSkill
- btp-business-application-studioSkill
- btp-ciasSkill
- btp-cloud-foundrySkill
- btp-cloud-identitySkill
- btp-cloud-loggingSkill
- btp-cloud-platformSkill
- btp-cloud-transport-managementSkill
- btp-connectivitySkill
- btp-developer-guideSkill
- btp-diagram-generatorSkill
- btp-integration-suiteSkill
- btp-job-schedulingSkill
- btp-master-data-integrationSkill
- btp-service-managerSkill
- cap-add-remote-serviceSkill
- cap-developerSkill
- cap-triviaSkill
- capture-answerSkill
- cap-upgradeSkill
- cds-view-entitiesSkill
- claude-abap-skillsSkill
- claude-memSkill
- clean-abapSkill
- context-modeSkill
- cpi-iflow-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Only need custom code for non-standard operations (actions, validations, determinations)
- Very specific: line 353
Deep Create: Use CREATE BY \_Assoc with %cid_ref and %target
- Very specific: line 363
Use %is_draft component (or %tky which includes it) to distinguish draft vs.
- Very specific: line 392
Always use strict ( 2 ); for new BOs
- Very specific: line 393
Prefer %tky over %key for future-proof code (handles draft/late numbering transitions)
- Very specific: line 394
Always fill %cid in create operations even if not referenced later
- Very specific: line 395
Use IN LOCAL MODE in handler methods to bypass feature controls and authorization checks
- Distinctive: line 397
Keep handler methods focused.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RAP (RESTful ABAP Programming Model)
Guide for building transactional applications using the ABAP RESTful Application Programming Model (RAP) in ABAP Cloud.
Workflow
- Determine the user's goal:
- Creating a new RAP BO from scratch
- Adding behavior (actions, validations, determinations) to an existing BO
- Writing EML statements to consume a RAP BO
- Troubleshooting RAP-related issues
- Understanding RAP concepts
- Identify the scenario:
- Managed (greenfield) vs. unmanaged (brownfield)
- Draft-enabled or not
- Numbering concept: early/late, internal/external/managed
- Single entity or composition tree (root + children)
- Guide implementation following the RAP layered architecture:
- Data modeling (database tables → CDS view entities)
- Behavior definition (BDEF using BDL)
- Behavior implementation (ABAP behavior pool)
- Business service exposure (service definition → service binding)
- Provide code examples using correct BDL and EML syntax
RAP Architecture Layers
| Layer | Artifacts | Purpose |
| Data Modeling | Database tables, CDS root/child view entities | Data persistence and semantic data model |
| Behavior Definition | BDEF (.bdef) | Declares transactional behavior (operations, characteristics) using BDL |
| Behavior Implementation | ABAP behavior pool (BP_*) | Implements business logic in handler/saver classes |
| Projection | CDS projection views, projection BDEF | Adapts BO for specific service consumers |
| Business Service | Service definition, service binding | Exposes BO as OData service |
Implementation Types
Managed (Greenfield)
- Framework handles transactional buffer and standard CRUD operations automatically
- Only need custom code for non-standard operations (actions, validations, determinations)
- Automatic save handling (can be enhanced with
additional saveor replaced withunmanaged save)
managed implementation in class zbp_r_entity unique;
strict ( 2 );Unmanaged (Brownfield)
- Developer provides transactional buffer and implements all operations
- Used when existing business logic needs to be embedded in RAP
unmanaged implementation in class zbp_r_entity unique;
strict ( 2 );Behavior Definition (BDL) Quick Reference
Complete BDEF Structure
managed implementation in class zbp_r_root unique;
strict ( 2 );
with draft;
define behavior for ZR_Root alias Root
persistent table zroot_tab
draft table zroot_d
etag master LocalLastChangedAt
lock master
total etag LastChangedAt
authorization master ( global )
late numbering
{
// Field characteristics
field ( readonly ) RootUUID, CreatedBy, CreatedAt, LastChangedBy, LastChangedAt;
field ( mandatory ) Description;
field ( numbering : managed ) RootUUID;
// Standard operations
create;
update;
delete;
// Association to child entity
association _Child { create; }
// Actions
action doSomething result [1] $self;
static action createFromTemplate parameter ZD_CreateParam result [1] $self;
internal action recalculate;
// Validations
validation validateDescription on save { create; field Description; }
// Determinations
determination setDefaults on modify { create; }
determination calcTotal on modify { field Quantity, Price; }
// Draft actions
draft action Resume;
draft action Edit;
draft action Activate optimized;
draft action Discard;
draft determine action Prepare
{
validation validateDescription;
}
// Side effects
side effects
{
field Quantity affects field TotalAmount;
field Price affects field TotalAmount;
determine action Prepare executed on field Description affects messages;
}
// Events
event created;
event deleted parameter ZD_DeletedEvent;
// Mapping
mapping for zroot_tab corresponding
{
RootUUID = root_uuid;
Description = description;
}
}
define behavior for ZR_Child alias Child
persistent table zchild_tab
draft table zchild_d
etag master LocalLastChangedAt
lock dependent by _Root
authorization dependent by _Root
{
field ( readonly ) ChildUUID, RootUUID;
field ( numbering : managed ) ChildUUID;
update;
delete;
association _Root;
mapping for zchild_tab corresponding
{
ChildUUID = child_uuid;
RootUUID = root_uuid;
}
}Projection BDEF
projection;
strict ( 2 );
use draft;
define behavior for ZC_Root alias Root
{
use create;
use update;
use delete;
use action doSomething;
use association _Child { create; }
}
define behavior for ZC_Child alias Child
{
use update;
use delete;
use association _Root;
}Key BDL Elements
| Element | Syntax | Purpose |
| Managed numbering | field ( numbering : managed ) KeyField; | Framework assigns UUID keys automatically |
| Early numbering | early numbering | Custom key assignment in interaction phase via FOR NUMBERING handler |
| Late numbering | late numbering | Key assignment in save sequence via adjust_numbers saver method |
| Lock master | lock master | Root entity controls pessimistic locking |
| Lock dependent | lock dependent by _Assoc | Child entity delegates locking to parent |
| ETag | etag master FieldName | Optimistic concurrency control |
| Total ETag | total etag FieldName | Required for draft-enabled BOs |
| Draft | with draft; | Enables draft handling for entire BO |
| Collaborative draft | with collaborative draft; | Multi-user draft editing |
| Strict mode | strict ( 2 ); | Enables additional BDL syntax checks (use latest version) |
ABAP Behavior Pool (ABP)
Handler Class
CLASS lhc_root DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
" Standard operations (unmanaged only)
METHODS create FOR MODIFY
IMPORTING entities FOR CREATE Root.
" Action implementation
METHODS doSomething FOR MODIFY
IMPORTING keys FOR ACTION Root~doSomething RESULT result.
" Validation
METHODS validateDescription FOR VALIDATE ON SAVE
IMPORTING keys FOR Root~validateDescription.
" Determination
METHODS setDefaults FOR DETERMINE ON MODIFY
IMPORTING keys FOR Root~setDefaults.
" Instance feature control
METHODS get_instance_features FOR INSTANCE FEATURES
IMPORTING keys REQUEST requested_features FOR Root RESULT result.
" Instance authorization
METHODS get_instance_authorizations FOR INSTANCE AUTHORIZATION
IMPORTING keys REQUEST requested_authorizations FOR Root RESULT result.
ENDCLASS.
CLASS lhc_root IMPLEMENTATION.
METHOD doSomething.
" Read current instance data
READ ENTITIES OF zr_root IN LOCAL MODE
ENTITY Root
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(entities)
FAILED failed.
" Modify instances
MODIFY ENTITIES OF zr_root IN LOCAL MODE
ENTITY Root
UPDATE FIELDS ( Status )
WITH VALUE #( FOR entity IN entities
( %tky = entity-%tky
Status = 'DONE'
%control-Status = if_abap_behv=>mk-on ) )
FAILED failed
REPORTED reported.
" Fill result
result = VALUE #( FOR entity IN entities
( %tky = entity-%tky
%param = entity ) ).
ENDMETHOD.
METHOD validateDescription.
READ ENTITIES OF zr_root IN LOCAL MODE
ENTITY Root
FIELDS ( Description ) WITH CORRESPONDING #( keys )
RESULT DATA(entities).
LOOP AT entities INTO DATA(entity).
IF entity-Description IS INITIAL.
APPEND VALUE #( %tky = entity-%tky ) TO failed-root.
APPEND VALUE #( %tky = entity-%tky
%msg = new_message_with_text(
severity = if_abap_behv_message=>severity-error
text = 'Description must not be empty' )
%element-Description = if_abap_behv=>mk-on
) TO reported-root.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD setDefaults.
READ ENTITIES OF zr_root IN LOCAL MODE
ENTITY Root
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(entities).
MODIFY ENTITIES OF zr_root IN LOCAL MODE
ENTITY Root
UPDATE FIELDS ( Status CreatedAt )
WITH VALUE #( FOR entity IN entities
( %tky = entity-%tky
Status = 'NEW'
%control-Status = if_abap_behv=>mk-on ) )
REPORTED reported.
ENDMETHOD.
ENDCLASS.Saver Class
CLASS lsc_root DEFINITION INHERITING FROM cl_abap_behavior_saver.
PROTECTED SECTION.
METHODS finalize REDEFINITION.
METHODS check_before_save REDEFINITION.
METHODS save_modified REDEFINITION.
METHODS cleanup REDEFINITION.
METHODS cleanup_finalize REDEFINITION.
ENDCLASS.
CLASS lsc_root IMPLEMENTATION.
METHOD finalize.
" Final calculations before save
ENDMETHOD.
METHOD check_before_save.
" Final consistency checks
ENDMETHOD.
METHOD save_modified.
" Only needed for 'with additional save' or 'with unmanaged save'
" Raise business events here
IF create-root IS NOT INITIAL.
RAISE ENTITY EVENT zr_root~created
FROM VALUE #( FOR <cr> IN create-root
( %key = VALUE #( RootUUID = <cr>-RootUUID ) ) ).
ENDIF.
ENDMETHOD.
METHOD cleanup.
" Clear transactional buffer
ENDMETHOD.
METHOD cleanup_finalize.
" Rollback finalize changes on failure
ENDMETHOD.
ENDCLASS.EML (Entity Manipulation Language) Quick Reference
EML is the ABAP language for programmatically interacting with RAP BOs. Key operations: MODIFY ENTITY (create/update/delete/execute action), READ ENTITIES, COMMIT ENTITIES, ROLLBACK ENTITIES.
- Create:
MODIFY ENTITY ... CREATE FIELDS ( ... ) WITH VALUE #( ( %cid = '...' ... ) ) - Read:
READ ENTITIES OF ... ALL FIELDS WITH VALUE #( ( key = val ) ) RESULT DATA(result) - Update:
MODIFY ENTITY ... UPDATE FIELDS ( ... ) WITH VALUE #( ( %tky = ... ) ) - Delete:
MODIFY ENTITY ... DELETE FROM VALUE #( ( %tky = ... ) ) - Execute Action:
MODIFY ENTITY ... EXECUTE actionName FROM VALUE #( ( %tky = ... ) ) - Deep Create: Use
CREATE BY \_Assocwith%cid_refand%target
For full EML syntax with code examples, read references/eml-quick-reference.md.
Draft Handling
- Enabled via
with draft;in BDEF header - Requires separate
draft tablefor each entity - Draft table must include
"%admin": include sych_bdl_draft_admin_inc; - Draft actions (
Edit,Activate,Discard,Resume,Prepare) are implicitly provided - Use
%is_draftcomponent (or%tkywhich includes it) to distinguish draft vs. active instances
RAP Save Sequence
| Phase | Methods Called | Purpose |
| Early Save | finalize → check_before_save → (on failure: cleanup_finalize) | Ensure data consistency |
| Late Save | adjust_numbers → save / save_modified → cleanup | Persist data to database |
- Early save failures (sy-subrc = 4) return to interaction phase
- Late save is point of no return — either commit succeeds or runtime error
Key BDEF Derived Type Components
| Component | Purpose |
%cid | Content ID — unique preliminary identifier for new instances |
%cid_ref | Reference to a %cid in the same EML request |
%key | Primary key fields |
%tky | Transactional key (%key + %is_draft + %pid) — recommended |
%data | All key and data fields |
%control | Flags indicating which fields are provided/requested |
%is_draft | Draft indicator (draft-enabled BOs only) |
%pid | Preliminary ID (late numbering only) |
%target | Target instances for create-by-association |
%param | Action/function parameter values |
Best Practices
- Always use
strict ( 2 );for new BOs - Prefer
%tkyover%keyfor future-proof code (handles draft/late numbering transitions) - Always fill
%cidin create operations even if not referenced later - Use
IN LOCAL MODEin handler methods to bypass feature controls and authorization checks - Implement validations for data consistency checks, determinations for calculated fields
- Keep handler methods focused; use ABP auxiliary classes for shared logic
- For managed BOs, only implement handler methods for non-standard operations
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

