Skip to Content
avatar image
Former Member

FM Date_get_week is returning incorrect week value


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'.


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.


Please advise.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers