Technical reference for building transactional apps with the SAP ABAP RESTful Application Programming Model.

Install

mkdir -p .claude/skills/rap && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15397" && unzip -o skill.zip -d .claude/skills/rap && rm skill.zip

Installs to .claude/skills/rap

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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".
729 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Create new RAP Business Objects (BOs)
  • Add behavior definitions (BDEF) using BDL
  • Implement business logic in ABAP behavior pools
  • Write EML statements to consume RAP BOs
  • Enable draft handling for BOs
  • Expose BOs as OData services

How it works

The skill guides the user through the RAP layered architecture, providing code examples and explanations for data modeling, behavior definition, implementation, and service exposure.

Inputs & outputs

You give it
User goal (e.g., 'create a RAP BO'), scenario details (managed/unmanaged, draft-enabled), and ABAP code
You get back
ABAP code examples for BDEF, EML, and behavior pool implementations, or guidance on RAP concepts

When to use rap

  • Create RAP business objects
  • Implement behavior definitions and pools
  • Write EML statements
  • Enable draft support for BOs

About this skill

RAP (RESTful ABAP Programming Model)

Guide for building transactional applications using the ABAP RESTful Application Programming Model (RAP) in ABAP Cloud.

Workflow

  1. 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
  2. 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)
  3. 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)
  4. Provide code examples using correct BDL and EML syntax

RAP Architecture Layers

LayerArtifactsPurpose
Data ModelingDatabase tables, CDS root/child view entitiesData persistence and semantic data model
Behavior DefinitionBDEF (.bdef)Declares transactional behavior (operations, characteristics) using BDL
Behavior ImplementationABAP behavior pool (BP_*)Implements business logic in handler/saver classes
ProjectionCDS projection views, projection BDEFAdapts BO for specific service consumers
Business ServiceService definition, service bindingExposes 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 save or replaced with unmanaged 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

ElementSyntaxPurpose
Managed numberingfield ( numbering : managed ) KeyField;Framework assigns UUID keys automatically
Early numberingearly numberingCustom key assignment in interaction phase via FOR NUMBERING handler
Late numberinglate numberingKey assignment in save sequence via adjust_numbers saver method
Lock masterlock masterRoot entity controls pessimistic locking
Lock dependentlock dependent by _AssocChild entity delegates locking to parent
ETagetag master FieldNameOptimistic concurrency control
Total ETagtotal etag FieldNameRequired for draft-enabled BOs
Draftwith draft;Enables draft handling for entire BO
Collaborative draftwith collaborative draft;Multi-user draft editing
Strict modestrict ( 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 REDEFINIT

---

*Content truncated.*

When not to use it

  • When developing applications outside of ABAP Cloud
  • When building non-transactional applications

Limitations

  • It is specific to the ABAP RESTful Application Programming Model (RAP)
  • It focuses on transactional applications
  • It requires familiarity with ABAP Cloud environment

How it compares

This skill provides structured guidance and code examples for RAP development, simplifying the process of building transactional Fiori applications compared to learning from scratch.

Compared to similar skills

rap side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
rap (this skill)04moNo flagsAdvanced
fastapi-templates5202moNo flagsIntermediate
android-kotlin-development2685moReviewAdvanced
fastapi-pro794moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

5201,086

android-kotlin-development

aj-geddes

Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.

268679

fastapi-pro

sickn33

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

79181

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

telegram-mini-app

davila7

Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, payments, user authentication, and building viral mini apps that monetize. Use when: telegram mini app, TWA, telegram web app, TON app, mini app.

62163

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

Search skills

Search the agent skills registry