Variables in SAP BW/BI Reporting
SAP BW Variables Types and Processing types Matrix:
We can check the data provider in the object i_infoprov in debug in RSRT t.code. Check the Code snippet.
IF i_infoprov IS INITIAL
AND cl_rsroa_vq_services=>is_iobj_virtual( i_iobjnm ) = rs_c_true.
i_infoprov = cl_rsroa_vq_services=>get_infoprov_from_iobjnm( i_iobjnm ).
ENDIF.
----------------------------------------------------------------------------------------------
YTD from Input Date
Fiscal Year from Fiscal Period (OFISCYEAR from OFISCPER)
ENDIF.
AND cl_rsroa_vq_services=>is_iobj_virtual( i_iobjnm ) = rs_c_true.
i_infoprov = cl_rsroa_vq_services=>get_infoprov_from_iobjnm( i_iobjnm ).
ENDIF.
----------------------------------------------------------------------------------------------
YTD from Input Date
DATA: l_s_range TYPE rsr_s_rangesid,
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
WHEN 'ZYTD_DATE'.
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO
LOC_VAR_RANGE WHERE VNAM = 'ZPP_INP'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
CLEAR ZDAY.
CLEAR ZMON.
CLEAR ZYEAR.
ENDLOOP.
ZMON = LOC_VAR_RANGE-LOW+4(2).
ZYEAR = LOC_VAR_RANGE-LOW+0(4).
IF ZMON EQ '01' OR ZMON EQ '02'
OR ZMON EQ '03'.
ZYEAR = ZYEAR - 1.
ENDIF.
CLEAR ZMON.
ZMON = '04'.
ZDAY = '01'.
CONCATENATE ZYEAR ZMON ZDAY INTO L_S_RANGE-LOW .
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDIF.
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO
LOC_VAR_RANGE WHERE VNAM = 'ZPP_INP'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
CLEAR ZDAY.
CLEAR ZMON.
CLEAR ZYEAR.
ENDLOOP.
ZMON = LOC_VAR_RANGE-LOW+4(2).
ZYEAR = LOC_VAR_RANGE-LOW+0(4).
IF ZMON EQ '01' OR ZMON EQ '02'
OR ZMON EQ '03'.
ZYEAR = ZYEAR - 1.
ENDIF.
CLEAR ZMON.
ZMON = '04'.
ZDAY = '01'.
CONCATENATE ZYEAR ZMON ZDAY INTO L_S_RANGE-LOW .
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDIF.
Previous Fiscal Year from Fiscal Period: (PFY/LFY from OFISCPER)
DATA: l_s_range TYPE rsr_s_rangesid,
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
***********Previous Fiscal Year from Fiscal Period ***********
WHEN 'ZFY_PY'.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP_IN'.
LV_YEAR = loc_var_range-low+0(4).
LV_YEAR = LV_YEAR - 1.
l_s_range-low = LV_YEAR.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
***********Previous Fiscal Year from Fiscal Period ***********
WHEN 'ZFY_PY'.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP_IN'.
LV_YEAR = loc_var_range-low+0(4).
LV_YEAR = LV_YEAR - 1.
l_s_range-low = LV_YEAR.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
Fiscal Year from Fiscal Period (OFISCYEAR from OFISCPER)
DATA: l_s_range TYPE rsr_s_rangesid,
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
***********Fiscal Year from Fiscal Period *************
WHEN 'ZFY_CY'.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP_IN'.
l_s_range-low = loc_var_range-low+0(4).
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
***********Fiscal Year from Fiscal Period *************
WHEN 'ZFY_CY'.
IF i_step = 2.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP_IN'.
l_s_range-low = loc_var_range-low+0(4).
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
MTD (MTD from Input Date)
DATA: l_s_range TYPE rsr_s_rangesid,
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
WHEN 'ZPP_MTD'.
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO
LOC_VAR_RANGE WHERE VNAM = 'ZPP_INP'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
CLEAR ZDAY.
CLEAR ZMON.
CLEAR ZYEAR.
ENDLOOP.
ZMON = LOC_VAR_RANGE-LOW+4(2).
ZYEAR = LOC_VAR_RANGE-LOW+0(4).
ZDAY = '01'.
CONCATENATE ZYEAR ZMON ZDAY INTO L_S_RANGE-LOW .
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
loc_var_range type rrrangeexit.
DATA: LV_YEAR(4) TYPE N.
CASE i_vnam.
WHEN 'ZPP_MTD'.
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO
LOC_VAR_RANGE WHERE VNAM = 'ZPP_INP'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
CLEAR ZDAY.
CLEAR ZMON.
CLEAR ZYEAR.
ENDLOOP.
ZMON = LOC_VAR_RANGE-LOW+4(2).
ZYEAR = LOC_VAR_RANGE-LOW+0(4).
ZDAY = '01'.
CONCATENATE ZYEAR ZMON ZDAY INTO L_S_RANGE-LOW .
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
Comments
http://thecreatingexperts.com/category/sap-hana-training-in-chennai/
contact 8122241286