Most users want the system to assign a UUID key, but a migration program must keep the IDs from the old system. How do you let both work in one managed RAP business object?
Say your answer out loud first.
Practise another way
I use managed internal numbering without the readonly flag: field ( numbering : managed ) on the UUID key. SAP calls this optional external numbering.
When a consumer leaves the key initial, the framework fills it; when the migration passes a value, that value stays. For readable IDs from a number range I would use early numbering instead, and skip keys that are already filled, as SAP's sample does.
The terms. SAP's BDL cheat sheet splits numbering on two axes. When: early (during create, in the interaction phase) or late (in adjust_numbers, during the save).
Who: external (the consumer passes the key) or internal (the provider assigns it). With no specification, numbering is external.
Managed internal numbering
field ( numbering : managed ) OrderUUID;
The framework fills the key with a UUID on create. The key must be the primary key and a 16-byte raw type. Normally you add readonly, which makes numbering fully internal.
Optional external numbering. Leave out readonly. The framework then assigns a UUID only when the consumer passes an initial key. A migration class can send its legacy UUIDs with EML, while the Fiori app sends none:
MODIFY ENTITIES OF zr_order
ENTITY Order
CREATE FIELDS ( OrderUUID CustomerID )
WITH VALUE #( ( %cid = 'M1' OrderUUID = legacy_uuid CustomerID = '1001' ) )
MAPPED DATA(mapped) FAILED DATA(failed) REPORTED DATA(reported).
When the key is not a UUID. If the key is a readable number from a number range object, numbering : managed cannot help. Use early numbering and implement the FOR NUMBERING handler.
SAP's /DMO/BP_TRAVEL_M shows the pattern for optional external input: instances that already carry a key are mapped unchanged. Only the rest get numbers from cl_numberrange_runtime=>number_get. SAP notes this check is required when the BO is draft-enabled.
Duplicates. If the database already holds a row with the same primary key, saving that instance is rejected. For a migration, check for existing keys first or expect failed entries.
Pure external numbering is the right choice when the user always types the key: field ( mandatory : create, readonly : update ).
Release note. numbering : managed exists only in managed BOs. The options apply on SAP BTP ABAP environment (now SAP Business AI Platform, ABAP environment) and ABAP Platform 2022 or later.
Names optional external numbering, explains that numbering : managed fills only initial keys, and switches to early numbering with an idempotent handler for number-range keys.
Builds two separate BOs or a second create action, or says a managed UUID key can never be supplied from outside.
Keeping readonly on the UUID key and then wondering why the migration's keys are refused. Readonly forbids every consumer value; optional external numbering needs it removed.
- Where exactly do you draw a number-range number in early numbering, and what do you return in MAPPED?
- What happens if the migration sends a key that already exists?
- Why must the early numbering handler skip instances that already have a key in a draft BO?
4 official pages. Confidence: high. Checked 3 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.