Get Example source ABAP code based on a different SAP table
• EARLY NUMBERING ABAP_BDL_PROP
ABAP_RAP - early numbering>
ABAP_SYNTAX ... early numbering ...>
What does it do? Defines unmanaged early numbering> for all primary key fields of a business object entity>. Unmanaged early numbering means:
The RAP runtime engine> assigns values to the primary key fields.
How the value assignment takes place is defined by the application developer in the ABAP behavior pool> (therefore, it is called unmanaged>). The implementation must be done in the RAP handler method> FOR NUMBERING>>.
The key value for an instance is available in the transactional buffer instantly after the MODIFY>> request for CREATE> (which is why it is called early> numbering, as opposed to late numbering >). Unmanaged early numbering is defined in the entity behavior characteristics> for each entity behavior definition > separately. That means that some business object entities may use unmanaged early numbering, while others use different methods to fill the primary key fields. The affected key fields must be specified as readonly>. Currently available for managed RAP BOs > and for unmanaged>, draft-enabled> RAP BOs. In projection business objects> and RAP BO interfaces>, early numbering is automatically reused from the base BDEF and does not need to be explicitly defined.
ABAP_FURTHER_INFO For further conceptual background on early and late numbering, see the development guide for the ABAP RESTful Application Programming Model, section Numbering>.
Latest notes: Alternative options for numbering:
numbering:managed>>
RAP late numbering> NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 The following example shows a managed BDEF that defines unmanaged early numbering for the root view entity DEMO_RAP_EARLY_NUMBERING> >. The primary key field KeyField> is defined as readonly >. ABAP_NOTE This example is intentionally kept short and simple and serves demonstration purposes only. BDEF DEMO_RAP_EARLY_NUMBERING The ABAP behavior pool implements the local handler class earlynumbering_create>. This class assigns ascending integer values as primary keys for each entity instance. Code snippet: METH BP_DEMO_RAP_EARLY_NUMBERING(CCIMP)=>EARLYNUMBERING_CREATE You can see the complete source code in the BP_DEMO_RAP_EARLY_NUMBERING===CCIMP>>.
The ABAP class CL_DEMO_RAP_MANAGED_EARLY_NUMB>> uses EML> to access to RAP business object> and performs the following steps:
It creates three entity instances by specifying a value for the field CharField>.
It commits the three new entity instances to the database.
Using the AB_SQL SELECT> statement, it displays the content of the database table. It can be seen that the primary key field KEY_FIELD> of each entity instance contains a value, which was generated by means of unmanaged early numbering. ABAP_EXAMPLE_END