- Create a selection variable in the TVARVC table.
- Use transaction DELETE_FACTS and generate ABAP program and variant for the selective deletion of the infocube
- Create an ABAP Program to populate the dynamic variable in the TVARVC table.
- Add the ABAP Program from step 3 and step 2 to the process chain. The process chain will have following sequence of variants.
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.
By Surendra Kumar Reddy Koduruhttp://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/603a9558-0af1-2b10-86a3-c685c60071bc?QuickLink=index&overridelayout=true&39569533701241