Tuesday, November 3, 2015

How to determine simulation mode of DTP

Simulation mode of DTP is quite useful function of BW. When there are some issues with the data in target of transformation we can use it to see how actually the data was transformed. In particular we can see in the debugger what is going on with the data within the transformation.

For debugging of the DTP we use Simulation of the DTP.  While using system basically jumps into debugger. For details how to use it see this wiki or online documentation.

While the DTP is running in Simulation mode no data is uploaded into the data target. This basically means that no data is changed. Sometimes there is ABAP code within the transformation where we manipulate further data e.g. in custom tables. Of course running in the Simulation mode we want to avoid manipulating the data in custom tables. As these are the custom tables by SAP standard it is not guaranteed that data is not saved as it is not saved into the BW data targets. So it is up the BW developer to ensure that no data is changed in in custom tables.

To implement it we can leverage the attributes of Simulation mode of the transformation – means Simulation of the DTP. In custom coding we can easily identify heather the DTP is running in the simulation mode. The attribute of simulation DTP carries value "DTPR_SIMULATION" in the request. Here’s example ABAP coding:

    IF request NE 'DTPR_SIMULATION'.
      MODIFY dbtab …

This fragment of code can be used in any of start/end/expert routines.

No comments: