ABAP Keyword Documentation → ABAP − Reference → ABAP RESTful Programming Model → Behavior Implementations → Saver Class
Method ADJUST_NUMBERS
The method adjust_numbers of the local saver class is the third method of the saver sequence of the behavior implementation of a business object. If the second method of the saver sequence check_before_save does not return an error, the point has been reached after which a successful save is guaranteed for all involved business objects. After this point, the method adjust_numbers is called. This method implements the late numbering that is specified in the behavior definition of the business object.
The implementation of the method adjust_numbers assigns the final keys for the content IDs (%CID). The output of the method is a table that links the %PID with the respective final IDs. These final IDs are provided using the output parameter mapped so that temporary IDs can be exchanged.
The structure of the parameter mapped of the method adjust_numbers is different from the structure of the parameter mapped of the method FOR MODIFY .... FOR CREATE. The following two structures exist for the parameter mapped of the method adjust_numbers:
- %TMP
Contains the temporary keys that are specified in the output parameter mapped of the operation FOR MODIFY ... FOR CREATE.
- ID
Contains the final keys.
The method adjust_numbers does not return any failed keys or messages because the exchange of temporary IDs happens after the point at which a successful save is guaranteed for all involved business objects.
Other versions:
7.31 | 7.40 | 7.54
Tip
Ideally, the late numbering is implemented separately from the save. In many legacy applications, however, the final numbers are determined during the save. In this case, we recommend implementing the save logic in the method adjust_numbers and leaving the method save empty.