Skip to Content
0
Former Member
Dec 17, 2012 at 10:45 AM

Need help for below code

28 Views

Hi Friends,

I have written belw code to populate the month +2 value.

Here i have kept variable VAR_CL_MNTH (as Manditory and ready for input)

If i put 02.2012 and query result should show the result as 02.2012, 03.2012 and 04.2012.

The problem i am facing that the vairable value (02.2012) is not getting passed to I_T_VAR_RANGE.

==========================================================

WHEN 'VAR_CL_MNTH'.

Data: Year TYPE /BI0/OICALYEAR,
month TYPE N LENGTH 2,
zmonth Type N LENGTH 2,
zyear TYPE /BI0/OICALYEAR,
test LIKE l_s_range-low.

Data: calyear1 TYPE N LENGTH 8,
calyear2 TYPE N LENGTH 8.

IF I_STEP = 2.

READ TABLE I_T_VAR_RANGE INTO loc_var_range WITH KEY VNAM ='VAR_CL_MNTH'.
IF SY-SUBRC = 0.

CLEAR l_s_range.


Year = loc_var_range+0(4).
month = loc_var_range+4(2).
zmonth = month + 2.

concatenate month year into calyear1.
concatenate zmonth year into calyear2.

l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
l_s_range-low = calyear1.
l_s_range-high = calyear2.
APPEND l_s_range TO e_t_range.

=========================================================

Thanks

Samir.