SAP BI 7.0.and also to BI 3.5
Author: Yogeshwar Shelar
Date: 13th Dec 2013
This article gives you an approach for looping of process chain to execute some steps repeatedly with different selections or condition.
We come across some scenario where we have to run same process chain for multiple times for multiple selections or conditions. Here we need to loop our process chain with some stopping condition.
Loding data from DSO to Cube through DTP Sales Org wise. If there is large volume of Sales data, we can prefer to load it giving sales org selection.
Here we have a process chain which loads sales data from DSO to Cube through DTP. We can run the same process chain multiple times for different Sales org so that it will push data to cube Sales org wise. Here I have not implemented whole scenario. Have shared only approcah by means of which you can implement the scenario.
Steps involved in this scenario:
1) Create event in SM64 which will trigger this Process chain
2) Create a variant in table TVARVC which will be used as a counter to run process chain n number of times.
3) Program at the end of process chain which will trigger the same process chain in the loop.
4) Finally process chain which will have DTP to load data and a program at the end to trigger same process chain itself.
Step 1: Creating event in SM64
Step 2: Create a variant LOOP_COUNTER which will be used as a counter to run the process chain in the loop.
We will update the value of LOOP_COUNTER in table TVARVC after every run of process chain. It will control how many times we want to run our process chain in the loop.
Step 3: Create a program which will trigger same process chain by triggering event.
Consider we have in all 5 sales org for which we are going to load data from DSO to cube through DTP in the process chain. In order to load data one by one for each sale org, we will have to run same process chain for 5 times for 5 sales org.
Initialy value in COUNTER will be 1. As soon as data gets load for first sales org, value in COUNTER will be set to 1, likewise will increment COUNTER by 1 till it becomes 5. Once value of COUNTER becomes 5 then will will again set COUNTER to 1 and will terminate the process chain. Above program will take care of setting value of COUNTER and also triggering same process chain again in the loop till data for all sales org get loaded.
Peocess Chain Design:
Above process chain will be based on event we created in above step. In our case it is ZPC_LOOP_TEST
1) Once event ZPC_LOOP_TEST gets triggered by some way, It will start the process chain.
2) Data will be loaded for first sales org through DTP. You will have to give selection on sales org through routine at DTP level. To avoid complexity it is not shown in the article.
3) Program will check the value of COUNTER in the back end, it will trigger or end the process chain based on the value COUNTER in the backend.
I have just shown you approach to loop a process chain. you can implement the same appropriate to your requirement.