cancel
Showing results for 
Search instead for 
Did you mean: 

There is any function to add weeks in a CALWEEK?

Former Member
0 Kudos

Hi, we're trying to add weeks into a CALWEEK date. If we try to make a simple addition, to a CALWEEK it seems that the result is ok. But at the end of the year there is some problems. It continues adding and adding weeks (for example 70.2007). Is there any function that add weeks and add the year when the week is the last one?

Thanks in advance.

Best Regards,

Mónica

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Monica,

I did not try to search for the function module but here's an algorithm that will solve your problem:

1) Convert the calweek into a date using function module WEEK_GET_FIRST_DAY

2) Add 7 x the number of days to the date in #1 (note: dates are integers so you can just add using the normal abap +)

3) Convert the date from #2 into week using DATE_GET_WEEK

Hope this helps.

Former Member
0 Kudos

No, we are trying to use this in a Routine of ABAP.

Thanks in advance.

Best Regards,

Mónica Padilla

Former Member
0 Kudos

Hi

is this in a routine or ABAP code or is it in a macro function?