Explain numbering in RAP: early versus late, external versus internal, and managed versus unmanaged numbering.
Say your answer out loud first.
Practise another way
Numbering is how a primary key gets its value. Early numbering assigns the key at create time, in the interaction phase; late numbering assigns the final key in the saver method adjust_numbers during the save sequence.
External means the consumer supplies the key, internal means the provider does. Managed internal early numbering has the framework fill a UUID. Unmanaged early numbering uses a FOR NUMBERING handler, and late numbering suits number ranges.
Two questions describe every case: when is the key assigned, and who assigns it?
Early numbering: final key during the create in the interaction phase.
- External: the consumer provides the key like any field. This is the default. Mark the key
mandatory : create, readonly : update. - Managed internal:
field ( numbering : managed, readonly ) TravelUUID;The framework generates the UUID. The key must be a 16-byte type, such assysuuid_x16. Best default for new objects. - Unmanaged internal early:
early numbering;in the BDEF and aFOR NUMBERINGhandler method that assigns the key. Used in managed BOs for custom keys, and in unmanaged draft BOs. In unmanaged BOs without draft, your create implementation sets the key.
Late numbering: final key during the save sequence.
late numbering;in the BDEF and implementation in the saver methodadjust_numbers. SAP says late numbering is available for managed and unmanaged BOs, with and without draft. The SAP pages give no release number for managed late numbering, so check the release notes of your system.- Used for gap-free numbers such as invoices: the final key is set just before the database save, after all checks, so failed creates burn no numbers.
- Late is internal by definition, because the consumer is no longer involved.
- Until then the instance has a preliminary ID (
%pid), and themappedresponse for the late phase links%pidto the final key.
METHOD adjust_numbers.
LOOP AT mapped-travel ASSIGNING FIELD-SYMBOL(<t>).
<t>-TravelId = get_next_number( ). " your own number range call
ENDLOOP.
ENDMETHOD.
Draft effects
- With late numbering and draft, the draft table needs an obligatory
DRAFTUUIDkey, and child draft tables also getparentdraftuuid. Untiladjust_numbersruns, instances are identified by%pid. - Early numbering is the more common and simpler choice for draft.
Terminology. A numbering type is set per key field. Managed numbering means only numbering : managed (framework, UUID, early). Unmanaged numbering means your code assigns the key: early in FOR NUMBERING, or late in adjust_numbers.
Choosing
- UUID key, no business meaning: managed numbering.
- Consumer must pick the key: external.
- Custom key logic known at create: unmanaged early (
FOR NUMBERING). - Gap-free number range, assigned at save: late.
Good to add: the BDEF default is external when nothing is specified, which surprises people who forget readonly.
Organizes the answer by when and who, gives the BDEF syntax and method for each, and ties late numbering to number ranges and %pid.
Names early and late and says 'late is when saving' without the saver method or the mapped response.
Using early numbering with a number range object. Aborted or failed creates burn numbers and leave gaps, which late numbering avoids.
- What is the default numbering?
- Why does draft with late numbering need DRAFTUUID?
- How do you read the generated key after a create?
- Which numbering for a gap-free invoice number?
6 official pages and 2 prep guides. Confidence: medium. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.
- Prep guide Gives the question.