Enhance the Business Object Behavior With Unmanaged Internal Numbering
- How to define internal early numbering
- How to implement internal early numbering
- How to preview and test enhanced travel app
Prerequisites
- You need to have access to an SAP BTP, ABAP environment, or SAP S/4HANA Cloud, ABAP environment or SAP S/4HANA (release 2022 or higher) system.
For example, you can create free trial user on SAP BTP, ABAP environment. - You have downloaded and installed the latest ABAP Development Tools (ADT) on the latest Eclipse© platform.
- You have created an ABAP Cloud Project.
- Make sure, your system has the ABAP flight reference scenario. If your system hasn’t this scenario. You can download it here. The trial systems have the flight scenario included.
In the previous exercise, you’ve enhanced the data model of the business object (BO) entity Travel.
In the present exercise, you will define and implement the unmanaged internal early numbering to set the primary key TravelID
of new Travel instances during their creation in your application. You will also use the static field control to specify some fields to read-only.
A number range object will be used to determine the unique travel identifiers.
Reminder: Do not forget to replace the suffix placeholder ### with your chosen or assigned group ID in the exercise steps below.
Numbering: Numbering is about setting values for primary key fields of entity instances during runtime. Different types of numbering are supported in RAP which can be divided into two main categories:
Early numbering: In an early numbering scenario, the primary key value is set instantly after the modify request for the CREATE is executed. The key values can be passed externally by the consumer or can be set internally by the framework or an implementation of the FOR NUMBERING method. The latter will be implemented in the present exercise.
Late numbering: In a late numbering scenario, the key values are always assigned internally without consumer interaction after the point of no return in the interaction phase has passed, and the SAVE sequence is triggered. Further reading: Numbering