Users type the order number themselves when they create an order. It must be mandatory then and never changeable afterwards, and the audit fields must stay read-only. Write the field lines of your behavior definition and explain each one.
Say your answer out loud first.
Practise another way
I write static field characteristics in the entity behavior body. The key gets mandatory : create and readonly : update, so it is required on create and frozen afterwards.
The audit fields get readonly, because only the framework or my determinations fill them. Business fields the user must always fill get mandatory. These lines cost no code, and the Fiori UI reads them as field control.
Static field characteristics. In the entity behavior body you mark fields with fixed access rules. SAP's BDL cheat sheet lists the variants:
field ( mandatory : create, readonly : update ) OrderID;
field ( readonly ) CreatedBy, CreatedAt, LastChangedBy, LastChangedAt;
field ( mandatory ) CustomerID, OrderDate;
field ( readonly : update ) Currency;
field ( features : instance ) Discount;
What each line means
mandatory : create, readonly : updateon the key. This is the typical pair for external numbering, where the consumer supplies the key. A value is required when the instance is created; after that, the key can no longer change.readonlymeans a consumer may not set the field on create or update. Use it for administrative fields and for values derived by determinations. Your own code can still set them with EMLIN LOCAL MODE.mandatorymeans the field needs a value before the instance is persisted. The Fiori elements UI shows it as required.readonly : updatefreezes a non-key field once the instance exists, for example a currency chosen at creation.features : instanceis the only dynamic variant. The rule then lives in theFOR INSTANCE FEATUREShandler method.
Characteristics can be combined in one bracket, within limits that the syntax check enforces.
Why static first. Static rules need no handler and no read of the instance. They cannot be wrong at runtime, and they document the contract in the BDEF.
Reach for instance feature control only when the rule depends on the data, such as "read-only once approved".
Related lines you will meet
field ( numbering : managed, readonly ) OrderUUID;lets a managed BO assign a UUID key.mandatorydoes not replace a validation. A check that the customer exists still belongs in a validation with a clear message.
Release note. These characteristics work in managed and unmanaged BDEFs on SAP BTP ABAP environment (now SAP Business AI Platform, ABAP environment) and on ABAP Platform 2022, 2023 and 2025.
Writes the mandatory : create, readonly : update pair for an externally numbered key, readonly for audit fields, and says when dynamic feature control is needed instead.
Writes a validation or a determination to block key changes, or marks the key plain readonly so that nobody can ever enter it.
Marking a user-entered key as plain readonly. Then no consumer can supply it on create; external numbering needs mandatory : create plus readonly : update.
- Your own action must set a read-only status field. How do you do that?
- When is a mandatory field checked, and why do you still write a validation?
- What changes if the key should come from a UUID instead of the user?
3 official pages and 1 prep guide. Confidence: high. Checked 3 Dec 2026.
- Prep guide Gives the question.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.