What are field characteristics, strict mode and mapping in a behavior definition?
Say your answer out loud first.
Practise another way
Field characteristics control who may set a field: readonly, mandatory, or the more specific readonly:update and mandatory:create, plus numbering:managed for keys. They are static, and features:instance makes them dynamic.
Strict mode adds extra syntax checks, so I always write strict(2). Mapping connects the persistence field names to the CDS element names when they differ, and in managed BOs it is required when names do not match.
Field characteristics are declared in the BDEF body:
field ( readonly ) CreatedAt, LastChangedAt;
field ( readonly : update ) TravelId;
field ( mandatory : create ) AgencyId;
field ( numbering : managed, readonly ) TravelUUID;
field ( features : instance ) BookingFee;
readonly: consumers cannot set it. Typical for keys and admin fields (CreatedBy, timestamps).readonly : createor: updatelimits it to one operation.mandatory: a value must exist before the instance is persisted.mandatory : createis the typical key setting for external numbering.suppress: removes the field from the BDEF derived types and all RAP APIs.numbering : managed: the framework fills a 16-byte UUID key on create.features : instance: dynamic. You implementFOR INSTANCE FEATURES, for example to make a field mandatory only in a certain status.- Static characteristics are checked by the framework. They are not a substitute for authorization.
Strict mode
strict ( 2 );right after the header turns on extra syntax checks for the BDEF. SAP recommends the newest version, which is 2 at the time of writing.- The framework does the checking, so you add no code in the behavior pool. Some syntax warnings become errors, all operations (including draft actions) must be declared explicitly, and authorization implementation becomes mandatory. It is a prerequisite for BOs released with a release contract.
- SAP's best practice is strict(2) for all BOs, with a few exceptions such as business configuration BOs.
Mapping
mapping for ztravel { TravelUUID = travel_uuid; AgencyId = agency_id; }maps CDS element names (left) to database field names (right).- Needed when the names differ. For managed BOs, the persistent table field names must align with the entity element names, otherwise you must map them.
- Variants
correspondingandcontrolexist.controlmaps the control structure, used with unmanaged save. - If you see a mapping warning after generating a BO from a legacy table, this is usually why.
Draft-specific note: the draft table must reflect the CDS fields by alias name, so mapping only affects the persistent table.
Interview tip: show you know the difference between a static restriction and an authorization check. A readonly field is a design rule. An authorization check is a security rule.
Gives the syntax for each, knows features : instance is dynamic, and says strict(2) is checked by the framework.
Describes readonly and mandatory loosely and has never heard of strict mode or mapping.
Using `readonly` as authorization. Readonly only stops consumers from setting a value, and code in local mode can still change it.
- How would you make a field mandatory only when status is Booked?
- What does suppress do?
- Why does the managed save need a mapping?
- What does strict mode check that the default does not?
2 official pages and 1 prep guide. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.