Tuesday, April 19, 2022

Debugging End Routine in HANA runtime of BW Transformation

In BW’s Transformation that are set to be executed in HANA mode there is still possible to have an ABAP End Routine. Here’s a short guide on how to debug ABAP code in such End Routines.


Technically a place that where the ABAP code of the End Routine is embedded into overall code of the HAAP process is a generated ABAP class. As an example if HAAP name (variable I_HAAPNM) is TR_ZQPTTP4YE36NYCQEVA6P_A then the ABAP class name is /BIC/ZQPTTP4YE36NYCQEVA6P_A (variable R_CLASS_NAME). In that ABAP class there is a method called GLOBAL_END where it code is located.

There are two environments where such an End Routine can be debugged.

 

1. in SAP HANA Studio – First open the transformation and display the End Routine code. Do a right click on some executable ABAP statement and set the breakpoint via choosing "Toggle Breakpoint" context menu item. 


While being in BW Modeling perspective open respective DTP and via button on DTP’s toolbar called "Start execution of data transfer process" select "Simulate in Dialog" item. This action open an RSDTP t-code embedded in SAP HANA Studio. Here hit a Simulate button and continue as you would do the debugging in SAP GUI as described below.



2. in SAP GUI – The debugging is still possible in SAP GUI if one prefer to do so. While being in RSDTP t-code set a "Processing Mode" to "Serially in the Dialog Process (for Debugging)" position, check out "Expert Mode" checkbox and hit Simulate button.


Next, a following pop-up called "Debug Request" is shown. Here enable "Before Transformation" checkbox. After that run it.



After a while, an ABAP debugger screen of SAP GUI is presented. Follow to Break./Watchpoints tab of the ABAP Debugger. Create a new breakpoint here pointing to ABAP objects:



Class name       CL_RSDHAR_TGT

Method Name      IF_RSDHAR_TGT~EXTRACT

Once the new breakpoint is created, it is visible like below:



Run the debugger until the new breakpoint is reached. There may be few more stops caused by hardcoded BREAK-POINT ABAP statements until it is reached to. If the ABAP debugger finally stops at IF_RSDHAR_TGT~EXTRACT (CL_RSDHAR_TGT) breakpoint just scroll a little bit down to a place where a call of method o_execute_abap_endrout is located and place a another breakpoint there.



Once that new breakpoint at the call of method o_execute_abap_endrout is reached, you came into the point where the ABAP code of custom End Routine is executed.

No comments: