Lesson 2 of 6
ABAP gates: ATC and ABAP Unit for agent changes
9 min
Listen to this lesson
Contoso already runs ATC as a transport release gate with its check variants: ZCMC_CLOUD_DEV for ABAP Cloud development and ZCMC_CLASSIC_DEV for classic custom code, assigned by package. AI-written changes go through the same gates. What changes is how early the agent sees them, and three rules that close loopholes an agent would otherwise use.
ATC gates
SAP documents two ways to run ATC at transport release in ADT: the developer launches ATC explicitly in the Transport Organizer before releasing (SAP's recommended use), or ATC runs implicitly when the request or task is released, with findings shown in the ATC Problems view. For agent work, use both: the agent runs ATC on its objects while it works, and the release check reruns it independently.
SAP's ABAP MCP server makes the first part easy. Its documented tools include abap_run_atc to start an ATC run for given objects, abap_atc_get_result to fetch findings, abap_run_unit_tests to run ABAP Unit tests, abap_object_check to check objects for errors, and abap_atc_execute_deterministic_quickfixes for classic quick fixes. A coding agent connected to the server can check and correct its own work before a person sees it. SAP notes that support for the MCP tools requires a valid SAP Joule for Developers, ABAP AI capabilities license, and some tools consume AI capacity.
Clean core adds one more reason to keep ATC in the loop. Contoso's ZCMC_CLOUD_DEV variant, applied to the ZCMC_CLOUD software component, includes the ABAP Cloud rules: code may use only released APIs. Generated code is a frequent offender, because models have seen far more classic ABAP than ABAP Cloud, so they reach for direct table reads, unreleased function modules and statements that ABAP Cloud forbids. The syntax check in an ABAP Cloud software component stops many of these outright; the ATC variant catches the rest and reports them while the agent is still working, which is far cheaper than finding them at release.
Three rules that close loopholes
- Agents never request exemptions. The MCP server also offers
abap_atc_exemption_requestandabap_atc_exemption_approvers. An agent stuck on a finding will happily request an exemption for it. Deny that tool in the agent's permissions; exemptions go through Contoso's normal approval with a reason and expiry, raised by a person. - No new pragmas or pseudo-comments without review. Suppressing a finding in code is an exemption by another name. The reviewer checks every new pragma or pseudo-comment in the diff.
- AI fixes are changes too. SAP's server can apply AI-based quick fixes to supported ATC findings (
abap_atc_apply_ai_fix, which needs the Joule license). The fixed code goes through the same tests and review as any other change.
| Gate | Rule for AI-written ABAP | Where it runs |
|---|---|---|
| Syntax and activation | Clean; no inactive objects left in the transport | Agent (abap_object_check), then release |
| ATC | No priority 1 or 2 findings in the package's variant; no new exemptions requested by the agent | Agent (abap_run_atc), then transport release |
| ABAP Unit | All tests green; every changed public method has a test that would fail if its behavior were wrong | Agent (abap_run_unit_tests), then release and nightly |
| Coverage | At least 80% statement coverage for changed classes, Contoso's existing rule | Coverage run in ADT or ATC |
| Review | Kenji's team checks intent, authorization, tests and suppressions | Before release |
| Clean core | ABAP Cloud code uses released APIs only (cloud readiness checks in ZCMC_CLOUD_DEV) | ATC |
ABAP Unit: generated tests need a second look
SAP Joule for Developers can generate ABAP Unit tests from Project Explorer, the Outline view, the ABAP Coverage view or the ABAP Unit chat in Joule, for public, protected and private methods of global classes and public methods of local classes in global class pools. You choose to add tests to an existing test class or a new one, then Apply, Insert or Copy the generated code. SAP's own principles are a good review checklist: understand the problem domain, start small with one to three methods, review the generated tests against the specification, run the whole suite after every change, and fix failing tests before anything else.
Coverage alone can be gamed by tests that execute code without checking it. Add a cheap meaning check for agent-written tests: deliberately break the behavior (for example, make the core agreement status stay OPEN when it should become CLOSED), run the tests, and confirm at least one fails. If none fail, the tests prove nothing about that behavior. This is a manual form of mutation testing, and five minutes of it per change tells you more than the coverage figure.
What would you do?
An agent working on a RAP validation can't clear an ATC priority 2 finding and, through the MCP server, requests an exemption with the reason "false positive". The request reaches the approver list. What should Contoso change?
- AI-written ABAP passes the same ATC variants and transport release check as any change, explicitly and implicitly.
- SAP's ABAP MCP server lets an agent run object checks, ATC and ABAP Unit itself; exemptions and release stay with people.
- Deny the exemption-request tool to agents, review every new pragma or pseudo-comment, and treat AI quick fixes as changes.
- Review generated ABAP Unit tests against the specification, and break the behavior once to prove a test can fail.
Check your understanding · not graded
Lesson check
1. Which ABAP MCP server tool should Contoso deny to coding agents?
2. How does SAP recommend running ATC at transport release in ADT?
3. An agent-written test asserts that a result equals itself. What is the problem?
4. What quick check shows whether agent-written tests are meaningful?