Check a RAP behavior/service definition
check_rap_behaviorValidate RAP behavior definitions (.bdef.asbdef) and CDS service definitions (.srvd.srvdsrv) for syntax and structural consistency offline before they reach ADT.
Instructions
Check RAP behavior definitions (.bdef.asbdef) and CDS service definitions (.srvd.srvdsrv) for syntax and structural-consistency defects, offline, using abap-mcp's own BDL/SDL parser — abaplint does not deep-parse either file type (it stores a BDEF behind a single regex and a SRVD not at all), so this is the only static feedback these files get without a system. Reports the draft/etag/lock/authorization/numbering consistency set, strict-mode obligations, action/operation/validation/determination/side-effect coherence, projection 'use' statements against the base BDEF, and service 'expose' sets against the CDS entities you pass in the same call; with abapRelease set, it also flags constructs newer than that release from a bundled, dated copy of SAP's RAP BDL feature table. Use this when you have written or generated a BDEF/SRVD (by hand, from scaffold_rap_bo, or from a model that may have invented RAP syntax) and want it checked before it reaches ADT — and pass the base BDEF and the .ddls.asddls views alongside it, because the cross-file rules only run on files present in the call. It does NOT connect to SAP, does not activate anything, does not run ATC, cannot see DDIC tables, behavior-pool classes or CDS field types, and cannot certify that ADT would accept the file — the grammar is derived from SAP's published feature tables plus a 102-file corpus of Apache-2.0 SAP sample sources, so constructs it does not recognise are reported as info, never as errors. For ABAP classes use lint_abap; for a new BO use scaffold_rap_bo; for what a release added use explain_abap_release. Example: check_rap_behavior({ "files": [ { "filename": "zr_travel.bdef.asbdef", "source": "managed implementation in class zbp_travel unique;\nstrict ( 2 );\nwith draft;\n\ndefine behavior for ZR_Travel alias Travel\npersistent table ztravel\nlock master\n{ create; }\n" } ], "abapRelease": "2508" }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | The BDEF/SRVD files to check, plus any .ddls.asddls or base .bdef.asbdef you want cross-checked in the same call. Up to 32 files, 100k chars each — passing the base BDEF and the CDS views is what turns on the cross-file half of the rule set. | |
| strict | No | Run the strict-mode rules even when the BDEF does not declare strict/strict(2) — use it to see what a BO would have to fix before it can be released under the C0/C1 contract. Default false: strict rules run only on BDEFs that declare strict. | |
| abapRelease | No | Target ABAP Cloud release, e.g. "2508". When set, constructs whose SAP-documented minimum release is newer are reported as warnings (rule RAP900) from the bundled, dated feature table. Omit to skip release gating. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | One row per supplied file: what it was taken to be, and whether it parsed. | |
| summary | Yes | Counts, including the two honesty counters that make coverage gaps measurable. | |
| findings | Yes | Every rule finding, sorted by file, line, column, rule id. | |
| scopeNote | Yes | Exactly what this checker proves and does not prove — abaplint did not parse these files, and ADT remains the authority. | |
| validated | Yes | Checked by abap-mcp's own RAP parser + rule set at the stamped grammar/rules version. It does NOT claim abaplint parsed it, that SAP's parser would accept it, or that the object would activate. | |
| releaseGate | No | Present only when abapRelease was passed. | |
| rulesVersion | Yes | Which rule set judged them, e.g. "rap-rules/1.0.0". | |
| grammarVersion | Yes | Which BDL/SDL grammar read the files, e.g. "bdl/2026-09-10". |