rap
Skill0 starsChanged 3 months agoMITView on GitHub
Construcción de objetos de negocio con RAP: managed vs unmanaged, behavior definition (BDEF), draft, validaciones, determinaciones, acciones, autorizaciones y EML. Úsala cuando el usuario cree un business object RAP, un servicio OData con RAP, hable de BDEF, behavior pool, EML, draft, o determinaciones/validaciones.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- m0NSYuke/PaperLabtheir own version, first seen Nov 8, 2026
- dovoanhtruong/abap-agent-claudecode-workspacetheir own version, first seen Oct 12, 2026
- wkhori/raptheir own version, first seen Sep 15, 2026
- likweitan/abap-skillstheir own version, first seen Jul 14, 2026
- williamcorrea23/sap-router-skilltheir own version, first seen Jul 13, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- likweitan/abap-skills★ 72same name
- m0NSYuke/PaperLab★ 4same name
- dovoanhtruong/abap-agent-claudecode-workspace★ 3same name
- williamcorrea23/sap-router-skill★ 1same 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 repository12 other files it gives its agents.
- abap-cloud-migrationSkill
- abap-cloudSkill
- abapgitSkill
- abap-sql-amdpSkill
- abap-unit-testingSkill
- atc-cloudificationSkill
- authorization-iamSkill
- cds-view-entitiesSkill
- clean-abapSkill
- odataSkill
- rap-business-eventsSkill
- released-abap-classesSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 110
No accedas a la base de datos con SELECT dentro del pool: usa READ/MODIFY ENTITIES en modo local.
- Very specific: line 111
No emitas COMMIT WORK ni ROLLBACK: la coherencia transaccional la gestiona RAP.
“Common” is measured: kept by at least 6 in 10 of the 5 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)
Guía para construir objetos de negocio (BO) con RAP: modelo de datos CDS en capas, contrato de comportamiento (BDEF), implementación en el behavior pool y manipulación transaccional con EML.
Cuándo y cómo usarla
- Identifica el objetivo: crear un BO transaccional, exponerlo como OData, añadir acciones/validaciones/determinaciones o habilitar draft.
- Sitúa el contexto: elige managed (RAP gestiona la persistencia, caso habitual) o unmanaged (persistencia legacy propia); decide si necesitas draft.
- Aplica la arquitectura: root entity CDS, proyecciones interface/consumption, BDEF con el comportamiento, behavior pool con la lógica, y service definition + binding para publicar.
Capas de un BO RAP
- Root entity (
ZR_...): vista raíz sobre la tabla de persistencia, con campos de auditoría y ETag. - Interface projection (
ZI_...): contrato transaccional reutilizable (provider contract transactional_interface). - Consumption projection (
ZC_...): proyección para el consumidor (provider contract transactional_query). - Behavior definition (BDEF): qué operaciones y reglas expone el BO.
- Behavior pool: clase ABAP con la implementación de acciones, validaciones y determinaciones.
Behavior definition (managed)
El BDEF es el contrato declarativo del BO. Define CRUD, campos controlados, acciones, validaciones, determinaciones, autorizaciones y draft.
managed implementation in class zbp_r_travel unique;
strict ( 2 );
define behavior for ZR_Travel alias Travel
persistent table ztravel
draft table ztravel_d
lock master
total etag LastChangedAt
etag master LocalLastChangedAt
authorization master ( instance )
{
create;
update;
delete;
field ( numbering : managed, readonly ) TravelUuid;
field ( mandatory ) AgencyId, CustomerId;
field ( readonly ) LastChangedAt, LocalLastChangedAt;
action ( features : instance ) confirmTravel result [1] $self;
validation validateDates on save { create; field BeginDate, EndDate; }
determination calculateTotal on modify { field BookingFee, FlightPrice; }
side effects { field BookingFee affects field TotalPrice; }
draft action Resume;
draft action Edit;
draft action Activate optimized;
draft action Discard;
draft determine action Prepare { validation validateDates; }
mapping for ztravel { TravelUuid = travel_uuid; AgencyId = agency_id; }
}Puntos clave: con strict ( 2 ) es obligatorio declarar el tipo de lock; field ( numbering : managed ) genera el UUID automáticamente; los campos de auditoría van readonly; el draft exige total etag y las cuatro draft actions.
Managed vs unmanaged
- Managed: el framework RAP crea, actualiza y borra en la tabla de persistencia. Es el caso por defecto y el recomendado para desarrollos nuevos.
- Unmanaged: el desarrollador implementa manualmente la persistencia y el bloqueo (
lock master unmanaged). Se usa al envolver lógica legacy existente.
Implementación con EML
La lógica del behavior pool no usa SQL directo: manipula el BO con Entity Manipulation Language. Lectura y modificación en modo local dentro del contexto transaccional (nunca COMMIT/ROLLBACK explícitos).
METHOD confirmTravel.
READ ENTITIES OF ZR_Travel IN LOCAL MODE
ENTITY Travel
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(travels)
FAILED failed.
MODIFY ENTITIES OF ZR_Travel IN LOCAL MODE
ENTITY Travel
UPDATE FIELDS ( OverallStatus )
WITH VALUE #( FOR t IN travels
( %tky = t-%tky
OverallStatus = 'A' ) ).
READ ENTITIES OF ZR_Travel IN LOCAL MODE
ENTITY Travel
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(updated).
result = VALUE #( FOR t IN updated
( %tky = t-%tky %param = t ) ).
ENDMETHOD.Las tablas de trabajo se declaran con TYPE TABLE FOR UPDATE ZR_Travel e incluyen campos técnicos %tky, %key, %pky, %is_draft, %param.
Validaciones, determinaciones y autorizaciones
- Validación: bloquea el guardado si los datos no son válidos; reporta el error por
failed/reported, no conMESSAGE. - Determinación: rellena campos automáticamente
on saveuon modify; esos campos suelen serreadonly. - Autorización:
global(aplica a toda la entidad) oinstance(depende del registro concreto, por ejemplo el centro o sociedad). Genera métodos en el pool a implementar.
Buenas prácticas y errores comunes
- No accedas a la base de datos con SELECT dentro del pool: usa READ/MODIFY ENTITIES en modo local.
- No emitas
COMMIT WORKniROLLBACK: la coherencia transaccional la gestiona RAP. - Ordena el BDEF de forma lógica: operaciones, campos, acciones y por último validaciones/determinaciones.
- Recuerda devolver siempre
resulten las acciones conresult [1] $self, o la UI no reflejará los cambios. - Al activar draft, no olvides
total etagy las draft actions; sin ellas la app no arranca en modo borrador.
Referencias
- Cursos y másters SAP de Logali Tech: https://logalitech.com/masters
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.

