Skip to Content
0
Jul 19, 2020 at 06:39 AM

Value "20190629" is too long for variable ZV03_YESTERDAY

58 Views

Hi Team,

I am using input varibale to pass date and get yesterday date as below

** Input Key Date**

WHEN 'ZV01_KEYDATE'.
IF i_step = 1 .
CLEAR l_s_range.
l_s_range-low = sy-datum.
l_s_range-opt = 'EQ'.
l_s_range-sign = 'I'.
APPEND l_s_range TO e_t_range.
ENDIF.

** To get yesterday date as per input key date**

WHEN 'ZV03_YESTERDAY'.
IF i_step = 2.
READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZV01_KEYDATE'.
IF sy-subrc = 0.
l_s_range-low = loc_var_range-low - 1.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDIF.

But when i am passing date in keydate it is executing properly, but when it comes to yesterday date it is throwing error as below.