This video provides a detailed explanation on how to write and debug an end routine at the transformation level in SAP BW on HANA. The presenter discusses how to derive information for certain fields that are not directly mapped from the source, using ABAP logic or AMDP. The video also covers the concept of lookup functionality, where data is fetched from a different target during the data transfer process.
Key topics covered in the video session:
- Understanding Transformation and Routines: The presenter explains that routines can be written at different levels in a transformation using either ABAP logic or AMDP. The focus of this video is on end routines.
- Understanding the Need for End Routines: The presenter uses a transformation from ADS1 to ADS2 as an example, where some fields are not directly mapped from the source. The presenter explains that end routines are used to derive information for these unmapped fields based on certain business logic.
- Understanding the Business Logic for Deriving Fields: The presenter explains the logic for deriving the values for the fields ‘amount’, ‘currency’, ‘net price’, and ‘document currency’. The ‘net price’ and ‘document currency’ are derived from the Material Master data, while the ‘amount’ is calculated by multiplying the material quantity with the net price.
- Creating an End Routine: The presenter demonstrates how to create an end routine by clicking on the ‘End Routine’ button in the transformation. The presenter explains the structure of the end routine and where to implement the logic.
- Writing the End Routine: The presenter writes the end routine to derive the values for the four fields. The presenter explains the use of the ‘IF’ statement to check if the result package contains data, the use of the ‘SELECT’ statement to fetch data from the Material Master data, and the use of the ‘LOOP’ statement to update each record in the result package.
- Executing the End Routine: The presenter saves and activates the end routine, then creates a Data Transfer Process (DTP) and executes it. The presenter shows that the ‘net price’, ‘amount’, ‘currency’, and ‘document currency’ fields have been successfully updated in the target using the end routine.