How to derive Update Mode & Request ID in the Transformation
In Implementation or Support projects we all will have requirement where we might need to derive the Update mode in the Transformation.
Below is the code which would give the update mode.
DATA: LV_UMODE TYPE RSUPDMODE.
CALL METHOD P_R_REQUEST->GET_UPDMODE
R_UPDMODE = LV_UMODE.
LV_MODE now will hold F or D based on the Which DTP we execute.
Finding the Request ID of the Current load, we can use below code.
DATA: N_REQUID TYPE RSBKREQUID.
CALL METHOD P_R_REQUEST->GET_REQUID
R_REQUID = N_REQUID.
N_REQUID will store the Request ID
Hope it helps.
there is one more thing you should add in this context, because it saves a LOT of time during testing / Debugging...
Put that at the beginning of your start- or endroutine:
DATA: LF_REQUID30 TYPE RSREQUID.
LF_REQUID30 = P_R_REQUEST->GET_REQUID30( ).
IF LF_REQUID30 EQ 'DTPR_SIMULATION'.
In this way you don't have to set breakpoints manually in the generated program 😉
Thanks Martin for the suggestion.
Where we need to write routine either in Start routine or end routine.
You can do it either in Start or End routine..