Hi gurus,
i created a bex variable handling thru customer exit, for getting cumulative fiscal week period for KF. the user inputs calendar date, based on that need to calculate cumulative fiscal week for a KF for which i have written the following code: but while executing the query, after giving the input in calendar date throws error as "Error for variable in customer enhancement zweekvar".. i checked thru debugging the values are getting populated properly till Append l_s_range to e_t_range... am afraid did i miss anything?
Request help
Code :
data : d_date type SCAL-DATE,
d_week type SCAL-WEEK.
WHEN 'zweekvar'.
IF I_STEP = 2."AFTER VARIABLE POP UP"
READ TABLE i_t_var_range INTO loc_var_range WITH KEY VNAM = '0P_CSDAT' IOBJNM = '0CALDAY'.
IF SY-SUBRC = 0.
d_date = loc_var_range-low.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = d_date
IMPORTING
WEEK = d_week
EXCEPTIONS
DATE_INVALID = 1.
ENDIF.
IF SY-SUBRC = 0.
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
WEEK = d_week
IMPORTING
DATE = d_date
EXCEPTIONS
DATE_INVALID = 1.
ENDIF.
IF SY-SUBRC <> 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 0.
CLEAR : l_s_range.
l_s_range-low = d_date.
l_s_range-high = loc_var_range-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range to e_t_range.
ENDIF.
ENDIF.