Anda di halaman 1dari 6

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

table:
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 requests. Previous month data can be in any of these requests. In such a case
Delete overlapping request in Infocube functionality in process chain doesnt 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.

An entry will be created in TVAVRC table

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.

A program will generated automatically.

In order to follow naming convention you can rename the program to a Z program.
Create a variant of the generated program.

I created ZSELECT_DEL variant


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

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

Click on technical Information

Note down the screen field name.

Now click on attributes button

Give description to variant and turn the technical name on.

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

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

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 =Y
ear-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.

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

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-86a3c685c60071bc?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-aprocess-chain-with-a-filter-from-the-tvarvc-table

Anda mungkin juga menyukai