Quantcast
Channel: SCN : Blog List - SAP Business Warehouse
Viewing all articles
Browse latest Browse all 333

Using Selective deletion in a Process Chain with a filter from the TVARVC table

$
0
0

SCOPE: This document will explain “Selective deletion of infocube data in a process chain” based on fiscal period.

 

SCENARIO: Infocube is being loaded in such a way that we need to delete the previous month (Previous Fiscal period) data first and then reload it again in order to accommodate the changed data. The infocube contains many delta requests. Previous month data can be in any of these requests. In such a case ‘Delete overlapping request in Infocube’ functionality in process chain doesn’t work and we need to have ABAP program so that we could automate this in a process chain.

 

STEPS FOLLOWED:

  1. Create a selection variable in the TVARVC table.
  2. Use transaction DELETE_FACTS and generate ABAP program and variant for the selective deletion of the infocube
  3. Create an ABAP Program to populate the dynamic variable in the TVARVC table.
  4. Add the ABAP Program from step 3 and step 2 to the process chain. The process chain will have following sequence of variants.

     ABAP program from Step 3 --> ABAP program   from Step 2 --> DTP to load previous month data.

 

STEP 1:

Create a selection variable in the TVARVC table.

For this go to STVARV transaction à Select options Tab  à Click on Create and create a variable.

I have created ZPREV_FISC_PERIOD.

image1.png

An entry will be created in TVAVRC table

image2.png

 

STEP 2:

Go to transaction DELETE_FACTS. Provide the Infocube name for which you want to perform a selective deletion and select the radio button ‘Generate Selection Program’.

Click on execute.

image3.png

A program will generated automatically.

image4.png

In order to follow naming convention you can rename the program to a ‘Z’ program.

Create a variant of the generated program.

image5.png

I created ZSELECT_DEL variant

After you click on create you will see the following screen:

image6.png

 

Go to Fiscal period field and click F1, you will see the following screen.

image7.png

Click on technical Information

image8.png

 

Note down the ‘screen field’ name.

image9.png

Now click on attributes button

image10.png

Give description to variant and turn the technical name on.

image11.png

 

Go to fiscal period (which is C023) in this case and enter the selection variable as “T”.  (T: Table Variable from TVARVC (only option available)).

image12.png

 

Also provide the Name of variable (which we created in Step 1) and save the variant.

image13.png

 

STEP3:


Create an ABAP Program to populate the dynamic variable in the TVARVC table.

We need to apply logic such that based on system date and fiscal variant we determine the fiscal period and then load the previous fiscal period in the variable.

 

REPORT  Z_PRE_MONTH_TVARVC.

            DATA:w_datum LIKE sy-datum,
w_yy
TYPE T009B-BDATJ,
w_month
TYPE T009B-POPER,
w_fiscper
TYPE /bi0/oifiscper,
lt_tvarvc
type STANDARD TABLE OF tvarvc,
gs_tvarvc
TYPE tvarvc.

CONSTANTS: c_s TYPE rsscr_kind VALUE 'S'.

************fiscal month and Year from system date**********

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE              
= sy-datum
*   I_MONMIT             = 00
I_PERIV             
= 'V3' "Fiscal Variant
IMPORTING
E_BUPER             
= w_month
E_GJAHR             
= w_yy.
* EXCEPTIONS
*   INPUT_FALSE          = 1
*   T009_NOTFOUND        = 2
*   T009B_NOTFOUND       = 3
*   OTHERS               = 4


****If fiscal month is jan, previous fiscal month will be December and Year =Year-1


IF w_month = 10.
w_month
= 9 .
w_yy
w_yy - 1.
ELSE.
w_month
= w_month - 1.
ENDIF.


Concatenate  w_month  w_yy into w_fiscper.
gs_tvarvc
-low = w_fiscper.
gs_tvarvc
-sign = 'I'.
gs_tvarvc
-opti = 'EQ'.
gs_tvarvc
-name = 'ZPREV_FISC_PERIOD'."Variable name in TVARVC table
gs_tvarvc
-type = c_s.


append gs_tvarvc to lt_tvarvc.

Modify tvarvc FROM table lt_tvarvc.

FREE: gs_tvarvc.


Save and activate the program. You can also execute the program manually to check whether the TVARVC table is updated with required record or not.

image14.png

Step 4:


Add the ABAP Program from step 3 and step 2 to the process chain.

image15.png

Reference:

Using Selective Deletion in Process Chains


By Surendra Kumar Reddy Koduru
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/603a9558-0af1-2b10-86a3-c685c60071bc?QuickLink=index&overridelayout=true&39569533701241

Using Selective deletion in a Process Chain with a filter from the TVARVC table


By R. Beeren


http://scn.sap.com/community/data-warehousing/bw/blog/2013/11/20/using-selective-deletion-in-a-process-chain-with-a-filter-from-the-tvarvc-table


Viewing all articles
Browse latest Browse all 333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>