ERPClimb logoERPClimb
Behavior Definitions
RAP / CDS / ODataadvanced 10 min read

Behavior Definitions Part 5: Projection Behavior, Strict Mode and Stable Contracts

Preview · a free account unlocks the full lesson

Key takeaway

Understand the BDEF layers above the base BO — projection BDEFs for services and interface BDEFs for stable reuse — plus strict mode and the rules that keep a released RAP contract stable over time.

In this lessonShow sections

Visual overview

Behavior Definitions Part 5: Projection Behavior, Strict Mode and Stable Contracts — learning sheetFlow: For each consumer, create a projection with exactly the operations it needs → If other developers call your BO via EML, provide an interface BDEF and release it → Keep all new BDEFs on strict ( 2 ) → Before changing a released projection or interface, classify the change as compatible or breaking. Key ideas: PROJECTION BDEF — ONE CONSUMER'S VIEW; INTERFACE BDEF — A STABLE ENTRY POINT FOR OTHER DEVELOPERS; STRICT MODE; KEEPING CONTRACTS STABLE. Watch out: Breaking changes need a new projection/service version.ERPClimb.com / RAP / LESSON 5/5 / LEARNING SHEETBehavior Definitions Part 5: Projection Behavior, StrictMode and Stable Contracts1 · HOW IT FLOWS1For eachconsumer, createa projection…2If otherdevelopers callyour BO via EML…3Keep all newBDEFs on strict( 2 )4Before changinga releasedprojection or…2 · KEY IDEAS EXPLAINEDProjection Bdef — One Consumer's ViewIt does not define behavior; it selects it with"use": "use create; use update; useaction approve; use association _Item { create…Anything not listed is not available to thisservice — e.g. an API projection without delete,or without draft ("use draft;" omitted).Interface Bdef — A Stable Entry Point…Purpose: give other developers (other BOs,reports, extensions) a stable EML API to your BO,decoupled from the internal base BO.SAP uses this pattern for its released BOinterfaces (e.g. I_…TP), which you call with EMLin clean-core development.Strict Modestrict — the first strict mode; enforces bestpractices at syntax-check level.strict ( 2 ) — the current, stricter version; forexample it requires explicit authorizationdeclarations and stricter checks on draft and…Keeping Contracts StableAdding a new optional field, a new action, a newdetermination or validation that does not rejectpreviously valid data.Removing an operation, action, field orassociation from a projection or interface.3 · REMEMBER · WATCH OUTRememberProjection BDEF = what one service may use ("use …").Interface BDEF = stable EML API for other developers.strict ( 2 ) for all new BDEFs.!Watch outBreaking changes need a newprojection/service version.4 · IN A REAL PROJECTTwo teams called a Purchase Request BO directly with EML on the base BO ZR_PurchReq. When the owning teamrefactored an action parameter, both consumer programs broke in the next transport to QAS. The owning teamintroduced an interface layer (ZI_PurchReqTP with an interface BDEF), released it, and asked consumers to…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

A projection BDEF defines what one specific service may use, declared through "use …" statements, while an interface BDEF provides a stable EML API for other developers. New BDEFs should always use strict ( 2 ), and breaking changes require a new projection or service version rather than modifying an existing contract.

Parts 1 through 4 covered the base BDEF (ZR_PurchReq), where behavior is actually defined — but consumers never use that base BDEF directly. This part covers the layers built on top of it, and how to change a business object without breaking the consumers depending on it.

A projection BDEF represents one consumer's view of the business object. It sits on a projection CDS view with provider contract transactional_query and starts with "projection;". Rather than defining behavior, it selects from what the base BO offers, with statements like "use create; use update; use action approve; use association _Item { create; with draft; }".

Anything not listed simply isn't available to that service — for instance, an API projection might omit delete, or omit draft entirely by leaving out "use draft;".

A projection can also add consumer-specific behavior on top, known as augmentation, such as defaulting a field only for that particular app, backed by its own implementation class — though this should be used sparingly.

A typical setup pairs a ZC_ projection for the Fiori UI, which includes draft, with a separate API projection that leaves draft out, a pattern covered further in Service Bindings Part 4.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.