1.0  INTRODUCTION

            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
                programs
.   

                     

                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.

        

                                                  STVARVC.PNG

                    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.

                      StartVariant.PNG
T

                      The event is created Z_TRIGGER_JOB using transaction SM62.

                  sm62.PNG

            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.

                Released.PNG

                      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.

                  DEC1.PNG

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

                        dec2.PNG

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

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

                            Dec3.PNG

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

          

                          Dec4.PNG

                 

                      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.

                Trig123.PNG

                                    

          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.

              trig2.PNG

            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 

          delays.       

                 

                       

           

           

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. 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

    Regards,

    AL

    (0) 
  2. 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.

    (0) 
  3. 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. 

    1) ADJUST_CALDAY

    2) ADJUST_CALMONTH.

    Can you look into this and update.

    Regards,

    Krishna Chaitanya.

    (0) 
    1. adwait badnikar Post author

      For Calday/Calmonth:

      Data Decl

      Data: Z_DAY Type /BI0/OICALDAY,

                Z_CALMONTH Type /BI0/OICALMONTH.

      FORM OFFSET_CALDAY.

         Z_DAY it_tvarvclow .
          Z_DAY Z_DAY  + p_offset.

        FREE: lx_tvarvc.
        lx_tvarvcname = p_name.
        lx_tvarvctype = ‘P’.
        lx_tvarvclow = Z_DAY.
        lx_tvarvcnumb = space.
        lx_tvarvcclie_indep = ‘X’.

        UPDATE tvarvc FROM lx_tvarvc.

      endform.

      FORM OFFSET_CALMONTH .

      Datamonth_high  TYPE i.

        Z_CALMONTH  = it_tvarvclow.

        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_tvarvcname = p_name.
        lx_tvarvctype = ‘P’.
        lx_tvarvclow = Z_CALMONTH.
        lx_tvarvcnumb = space.
        lx_tvarvcclie_indep = ‘X’.

        UPDATE tvarvc FROM lx_tvarvc.

      endform.

      We have a class cl_rs_time_service which has methods

      SHIFT_FISCPER

      SHIFT_YEAR_HALFYEAR

      SHIFT_YEAR_MONTH

      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 .

      Regards,

      Adwait Badnikar.

      (0) 

Leave a Reply