Automate DTP with ‘Init Without Data Transfer’ Processing Mode
Many times we are required to run more than one DTPs with processing mode ‘No Data Transfer; Delta Status in Source: Fetched’ that is init data load without data transfer. This will set the data mart flag for all the requests in source. There could be scenario where init DTP without data transfer is required to be scheduled. This document describes how to run init DTP without data transfer and also automate this through process chain.
What is init DTP?
Init DTP without data transfer is similar to init info package with update mode ‘Initialize Delta Process’ and ‘Initialize Without Data Transfer’. Init DTP is essentially a DTP with extraction mode (found on Extraction tab in DTP) ‘Delta’ but processing mode (found on Execute tab in DTP) is ‘No Data Transfer; Delta Status in Source: Fetched’. When init DTP runs, data mart flag for all the requests in source is set and they are not fetched in subsequent delta DTP run.
How to execute init DTP?
Only DTP with extraction mode ‘Delta’ can be executed as init DTP. Generally for a DTP, various processing modes can be used depending on type of source and target but to execute it as init DTP processing mode should manually be set to ‘No Data Transfer; Delta Status in Source: Fetched’ and hit the Execute button.
How to automate init DTP?
Problem is SAP does not allow to save a DTP with processing mode ‘No Data Transfer; Delta Status in Source: Fetched’. So you cannot schedule such DTP in process chain. Program ZBW_AUTO_INIT_DTP_WO_DATA performs this task. Code of the program is given below. When program is executed it prompts user for two inputs. First is for technical ID of delta DTP and second is for processing mode of DTP. Processing mode is available to select with F4 value help.
User will provide the technical ID of delta DTP and processing mode value 9 (‘No Data Transfer; Delta Status in Source: Fetched’) and execute the program. Program, in the background, will start the init request. This will save the user from manually setting the processing mode and executing the DTP.
Suppose you have a scenario where in you are creating a new info provider in BW system to store data for each year; and there may be more than one info providers where this activity needs to be followed. So at start of year, you are required to run the init DTP from all the sources to these new info providers.
Now, using the program provided below, this also can be automated using process chains. Create a variant in program for each DTP that needs to be run with init mode. Create a process chain and add the ABAP program step for each DTP providing DTP specific variant. This process chain can be scheduled to run the init DTP requests for all DTPs included in process chain.
*& Report ZBW_AUTO_INIT_DTP_WO_DATA
*& report facilitates run of delta DTP with processing mode
*& ‘No Data Transfer; Delta Status in Source: Fetched’
** data declaration
data: lcl_dtp type ref to cl_rsbk_dtp,
lcl_request type ref to cl_rsbk_request,
w_loc_dtp type rsbkdtpnm,
lv_dtp type rsbkdtpnm,
lv_mode type rsbkprocessmode,
ls_dtpinfo type rsbkdtp.
** parameter details
selection-screen begin of block input with frame title text–001.
parameters: dtp_id like lv_dtp,
process like lv_mode.
selection-screen end of block input.
** check DTP is a delta dtp
select single * into ls_dtpinfo from rsbkdtp
where dtp = dtp_id and
updmode = ‘D’. “delta mode
if sy–subrc <> 0.
write: ‘DTP’, dtp_id, ‘is not a delta DTP.’. new-line.
write: ‘Please select delta DTP for init operation.’.
** create DTP object
w_loc_dtp = dtp_id.
lcl_dtp = cl_rsbk_dtp=>factory( w_loc_dtp ).
** create DTP request
call method lcl_dtp->if_rsbk_dtp_execute~create_request
r_r_request = lcl_request.
** change the processing mode of created request
if ( process = ‘9’).
** if input is 9, set request processing mode as NODATA
** i.e. init without data transfer
lcl_request->set_ctype( ‘NODATA’ ).
elseif ( process = ‘1’).
** if input is 1, set request processing mode as ASYNC i.e. normal
lcl_request->set_ctype( ‘ASYNC’ ).
** start the data load request
call method lcl_request->if_rsbk_request~doit
i_no_commit = rs_c_false.
write: ‘Init request without data transfer for DTP’,
dtp_id, ‘is in progress.’.
1. Execute program.
2. Provide parameters.
3. Execute the program. A init DTP request will be created and become active.
4. Check the init request loaded in info provider target. Check that check box for ‘DeltaInit’ is ticked which means all requests in source are marked for data mart flag.
Also no records were extracted.
Automate Using Process Chain:
1. Create a process chain and include the ABAP program step for above program.
2. Provide the program variant saved for processing the DTP.
3. Execute the process chain.
Request created as a result of execution of this process chain will be init DTP request without data transfer. You can create variants for other DTPs and add them too in the process chain to automate the operation.