The method save of the local saver class is the fourth method of the saver sequence of the behavior implementation of a business object. It is called to save all data of the business object instance from the transactional buffer to the database.
The method save does not have any output parameters and does not return any failed keys or messages.
The implementation of the method save is mandatory.
Once the data is saved to the database, the transactional buffer is deleted. This is because the same ABAP session is potentially used for more than one LUW and any remaining changes in the transactional buffer can cause inconsistencies.
7.31 | 7.40 | 7.54
In the following example, the data from the ABAP flight data reference scenario (or flight data scenario for short) is used. It represents a legacy business logic that can be used to create and edit flight bookings. The root entity Travel represents the business object for managing flight trips. The underlying data model and the behavior of the root entity Travel are described in ABAP BDL - Example.
In the method save, the function module of the legacy business logic /DMO/FLIGHT_TRAVEL_SAVE is called.
INHERITING FROM cl_abap_behavior_saver.
METHODS save REDEFINITION.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_SAVE'.
/dmo/cl_flight_legacy=>get_instance( )->save( ).