Thursday, October 27, 2011

Calculations with key date

A bit of follow up to the previous post ... we'd like to have the key date at hand for performing some calculations, unfortunately we didn't find an easy way so with some micro abap we managed to get that variable into another variable (??) that can be used.
Coding for variables (CMOD on BW side, EXIT_SAPLRRS0_001, include ZXRSRU01 etc.) follows:
Wish there was a simpler way ...
Code:
case i_vnam.
 when 'YV_DAY_2_VAR'.
    if i_step = 2.
      loop at i_t_var_range into loc_var_range where vnam = 'YV_DAY'.
 clear: l_s_range. 
       l_s_range-low = loc_var_range-low.
       l_s_range-sign = 'I'.
       l_s_range-opt = 'EQ'.
 append l_s_range to e_t_range.
      endloop.
    endif.