Skip to Content
Author's profile photo Adwait Badnikar

Automate recursive triggering of Process Chains in SAP BW using TVARVC table


            1.1 Scenario and Requirement

              We had to perform reloads in the  cube and DSO after change in Transformation Logic . The Data was first loaded in a Standard DSO and then into the cube.

–  The Challenge was to perform reloads for data for last five calendar years is from 2007 -2012. Full loads and the DSO activations were  consuming huge amount of time and system resources. Hence due to the high data volume the load had to be performed on 0FISCPER  basis.

– Once the process chain execution for a particular 0FISCPER  is complete the 0FISCPER  selections had to be changed manually and the chain  had to be triggered again  resulting in delays.

                    Hence the TVARCV table is used to update the info package selections .


            1.2 TVARCV Table

                TVARCV table is SAP R/3 table of which can be updated/changed manually(using SM30) or by using transactions STVARVC or ABAP


                Creating Entries in TVARCV table             

                    Go to transaction STVARVC and click on the create option. Create a variable of type 0FISCPER as our info package selection is 0FISCPER.



                    1.3  Prerequisites

                  –  Basic Knowledge of ABAP programs and Program Variants.

                  –  Basic Knowledge of Process Chains and variants Like Decision variables, Start Variant settings etc.

                  –  Basic Knowledge of Events and Triggering Process Chains using ABAP programs.

                  –  Basic Knowledge of Delta settings of DTPs.

            2.0  Process Chain Structure:


                    Process Chain structure is as follows  

                    Process Chain.PNG 

                Detailed explaination of each variant in the chain  is given below.


                  2.1  Start Variant of the Process Chain:


      The start variant will have the setting as shown below.It means that the Process chain will be triggered each time the event Z_TRIGGER_JOB.

            The event is raised by an abap program which is added at the end of the chain.

    The job setting is kept periodic since the chain has to be triggered recursively. Due the the periodic setting  a new scheduled job is created as soon    as one run of the job is complete.


                      The event is created Z_TRIGGER_JOB using transaction SM62.


            Once the design of the chain is complete the chain is scheduled.We can also see the scheduled job of the start variant.

            The Jobs of the process chain will be in ‘RELEASED’ state until the Event is raised.

            The released state of the Jobs will prevent the chain from  executing.

            Once the event is raised  the job is gets FINISHED the Chain Execution starts.


                      2.2 Infopackage Routine

          The infopackage routine will extract the value from TVARCV table and populate the value in the

          range table of the info package  selection .

                          Infp Routine.PNG

                        Value in TVARCV table:


                        TVARCV Table.PNG

                        Info package O/P

                        IP Output.PNG

                2.3 Updating TVARVC Table Using ABAP program

                The purpose  of this program is to increment the value of ‘ZTEST_158’ in TVARCV table so that we get a new selection for the infopackage

                for the next process chain execution.


                Selection screen will have Variable,  variable type and offset as input.The program will automatically update the Entries in the TVARCV table. Also

                a variant will be created for the same which will be used in the process chains.

                          Program to TVARCV.PNG

          Ip OP.PNG

                In process chain 


                              in PC.PNG

              2.4 Creating Custom Function in Decision Variable

                The main purpose of the decision variable is to prevent the process chain from executing infinite number of times using some condition which

                  in our case is 0FISCPER selection . The Chain should trigger recursively untill the value of ‘ZTEST_158’ becomes 2013001.

              This is done by  creating custom defined functions which can be used in decision variables.

                Following are the steps to create custom functions using decision variables


                  1. Go to transaction SE19 and create implementation for BADI ‘RSAR_CONNECTOR’.

                  This will automatically create a class ZCL_IM_DEMO_CUSTOM.


              2.  Go to Transaction SE24 and create a method ‘C_GET_TVARVC_DATA’ as shown.


                  3.  Again go to SE19 transaction and open the implementation.

                        In the GET method of the Implementation  write the following code.


                          4  In the process chain Decision Variable we can add the Custom defined function.




                      2.5  Triggering Process Chain  Using Events:


            The Decision variable will check if the fiscper is GT 2013001.

            If the variable value is GT 2013001 it will execute the Full  DTP load from DSO to cube.

            If the variable value is LT 2013001 it will execute the execute an ABAP program which will trigger the same chain again.

            The chain will be triggered by raising an event and parameter  maintained in the start variant in the chain.

            The ABAP program and the variant will be added in the process chain as shown in the Process chain structure.



          The ABAP program will use the standard function module ROPC_EVENT_RAISE’  to raise the event.

          the FM will take the EVENT and PARAMETER as input.


            As discussed earlier,once the chain is created it is scheduled.

            For only  the FIRST run of the chain the triggere will be provided manually

              i.e by executing the trigger program manually with  the variant .


          Hence using the recursive process chain we can automate the reloads and reduce manual intervension and 






Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Matthew Billingham
      Matthew Billingham

      You had the title in ALL CAPITALS. I've changed that and corrected the typo in the table name.

      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Thanks for sharing this..can be helpful where we have to reload loads of data to dso and cube..Of course DSO activation takes huge time for more no. of records.Splitting the data load based on Fiscal year seems to be nice approach.

      Good to know about automation of data load through custom programs and standard function module



      Author's profile photo Former Member
      Former Member

      Good approach for dynamic data loads...



      Author's profile photo Former Member
      Former Member

      Nice read adwait.

      Author's profile photo Former Member
      Former Member

      Nice doc adwait..

      Author's profile photo Suhas Karnik
      Suhas Karnik

      Good doc!

      Wish I'd known this a few months ago when I had to reload data of over 10 years. We did it the hard (i.e. manual) way, this would have saved a lot of time.

      Author's profile photo Former Member
      Former Member

      Nice approach !

      In my case I have hard coded the increment and decisive factor.

      Good to see implementation and usage of classes in PC.

      Thanks & regards,


      Author's profile photo Krishna Chaitanya
      Krishna Chaitanya

      Really a very good document.  It was easy to implement.  Thanks for sharing.

      But unfortunately I could not find the coding for two performs. 



      Can you look into this and update.


      Krishna Chaitanya.

      Author's profile photo adwait badnikar
      adwait badnikar
      Blog Post Author

      For Calday/Calmonth:

      Data Decl

      Data: Z_DAY Type /BI0/OICALDAY,

                Z_CALMONTH Type /BI0/OICALMONTH.


         Z_DAY it_tvarvc-low .
          Z_DAY Z_DAY  + p_offset.

        FREE: lx_tvarvc.
        lx_tvarvc-name = p_name.
        lx_tvarvc-type = 'P'.
        lx_tvarvc-low = Z_DAY.
        lx_tvarvc-numb = space.
        lx_tvarvc-clie_indep = 'X'.

        UPDATE tvarvc FROM lx_tvarvc.



      Datamonth_high  TYPE i.

        Z_CALMONTH  = it_tvarvc-low.

        month_high = Z_CALMONTH.

        cl_rs_time_service=>shift_year_month( exporting i_year_month = month_high i_SHIFT = p_offset RECEIVING r_year_month = Z_CALMONTH ).

        FREE: lx_tvarvc.
        lx_tvarvc-name = p_name.
        lx_tvarvc-type = 'P'.
        lx_tvarvc-low = Z_CALMONTH.
        lx_tvarvc-numb = space.
        lx_tvarvc-clie_indep = 'X'.

        UPDATE tvarvc FROM lx_tvarvc.


      We have a class cl_rs_time_service which has methods




      SHIFT_YEAR_QUARTER etc which can be used for shifting months calyears etc

      Pl let me know if the above code to offset Calmonth and Calday has worked .


      Adwait Badnikar.

      Author's profile photo Satendra Mishra
      Satendra Mishra

      Nice information and really very helpful 🙂



      Author's profile photo Wasem Hassan
      Wasem Hassan


      Nice one doc. 🙂



      Author's profile photo Former Member
      Former Member

      Nice Document.



      Author's profile photo Former Member
      Former Member

      Really helpful doc.