Skip to Content
0
Former Member
Sep 19, 2016 at 09:06 AM

Customer Exit revision for Month conversion to week

21 Views

Hi,

User Entry Variable: CalMonth Interval Mandatory. i.e. ZMONTH_ENTER

Below code needs to be revised for Month but not on calendar date. Please do the needful.

Thanks

SS

DATA: range_low TYPE d,

range_high TYPE d,

fisc_var_range-low TYPE d.

WHEN 'ZRANGE_AUTO'.

IF i_step = 2.

LOOP AT i_t_var_range INTO fisc_var_range WHEREvnam = 'ZDAY_ENTER'.

IF fisc_var_range-low+6(2) >= '01' ANDfisc_var_range-low+6(2) <= '07'.

CONCATENATE fisc_var_range-low(6) '01' INTOrange_low.

CONCATENATE fisc_var_range-low(6) '07' INTOrange_high.

ELSEIF fisc_var_range-low+6(2) >= '08' ANDfisc_var_range-low+6(2) <= '14'.

CONCATENATE fisc_var_range-low(6) '08' INTOrange_low.

CONCATENATE fisc_var_range-low(6) '14' INTOrange_high.

ELSEIF fisc_var_range-low+6(2) >= '15' ANDfisc_var_range-low+6(2) <= '21'.

CONCATENATE fisc_var_range-low(6) '15' INTOrange_low.

CONCATENATE fisc_var_range-low(6) '21' INTOrange_high.

ELSEIF fisc_var_range-low+6(2) >= '22' ANDfisc_var_range-low+6(2) <= '28'.

CONCATENATE fisc_var_range-low(6) '22' INTOrange_low.

CONCATENATE fisc_var_range-low(6) '28' INTOrange_high.

ELSEIF fisc_var_range-low+6(2) >= '29' ANDfisc_var_range-low+6(2) <= '31'.

IF fisc_var_range-low+4(2) = '01' ORfisc_var_range-low+4(2) = '03'

OR fisc_var_range-low+4(2) = '05' ORfisc_var_range-low+4(2) = '07'

OR fisc_var_range-low+4(2) = '08' ORfisc_var_range-low+4(2) = '10'

OR fisc_var_range-low+4(2) = '12'.

CONCATENATE fisc_var_range-low(6) '29'INTO range_low.

CONCATENATE fisc_var_range-low(6) '31'INTO range_high.

ELSEIF fisc_var_range-low+4(2) = '04' ORfisc_var_range-low+4(2) = '06'

OR fisc_var_range-low+4(2) = '09' ORfisc_var_range-low+4(2) = '11'.

CONCATENATE fisc_var_range-low(6) '29'INTO range_low.

CONCATENATE fisc_var_range-low(6) '30'INTO range_high.

ELSEIF fisc_var_range-low+4(2) = '02'.

CONCATENATE fisc_var_range-low(6) '29'INTO range_low.

CONCATENATE fisc_var_range-low(6) '29'INTO range_high.

ENDIF.

ENDIF.

l_s_range-low = range_low.

l_s_range-high = range_high.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

EXIT.

ENDLOOP.

ENDIF.