In this tutorial, lets analyse how to work on Draft class to retrieve data from other entities and push all the data model’s data into respective tables. For our Airline scenario, we don’t have any specific business logic, so direct INSERT or UPDATE or DELETE operations to DB will work.
Our objective inside the Draft class is to collect the data from all the entities and then do DB operations accordingly.
In the Draft generated class, we redefine method /bobf/if_frw_draft~copy_draft_to_active_entity to apply our business logic for the Save sequence.
To retrieve the own data model entity and its child data model entities retrieve() and retrieve_by_association() methods can be used respectively. Follow the below code for retrieving the data from all the entities.
Once the retrieval is complete, data has to be organised in order to find whether the data has to be inserted or updated. Table type of each