cancel
Showing results for 
Search instead for 
Did you mean: 

FM Date_get_week is returning incorrect week value

Former Member
0 Kudos

Hi,

I have calweek Customer exit variable which provides range of current week-7 to current week. The code uses SAP FM Date_Get_Week which is returning 201794 for the date 1/5/2018 .I guess it is assuming 100 weeks in a year with current week being 00/2018.

this is the code

Data: input1 type RRRANGEEXIT,

output1 type RRRANGESID,

week_start type /BI0/OICALWEEK,

week_end type /BI0/OICALWEEK,

week_value type /BI0/OICALWEEK.

when: 'ZCALWEEK'.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING date = sy-datum

IMPORTING week = week_value.

week_start = week_value - 7.

week_end = week_value.

if i_step = 1.

output-sign = 'I'.

output-opt = 'EQ'.

output-low = week_start.

output-high = week_end.

append output to e_t_range.

endif.

Please advise.

Accepted Solutions (0)

Answers (0)