Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

calculate date

Former Member
0 Likes
463

Hi

i look for Fm that i give here start date and number of week and the FM will calculate start date + number week(in days)

for example 30/12/2007 ( the month end in 31 )

i will give one month or 4 week the answer will be 27/01/08

Thanks

have a nice day

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
440

Hi ,

You Dont need any FM for this , this behavious is automatically provided by the Date type field.

see sample code

data : date1 like sy-datum,

date2 like sy-datum.

var = number of weeks * 7.

date1 = '20071230'.

date2 = date1 + var.

write : date1 , date2.

Reward points if useful.

Regards,

Gaurav

Hi

i look for Fm that i give here start date and number of week and the FM will calculate start date + number week(in days)

for example 30/12/2007 ( the month end in 31 )

i will give one month or 4 week the answer will be 27/01/08

Thanks

have a nice day

2 REPLIES 2
Read only

Former Member
0 Likes
441

Hi ,

You Dont need any FM for this , this behavious is automatically provided by the Date type field.

see sample code

data : date1 like sy-datum,

date2 like sy-datum.

var = number of weeks * 7.

date1 = '20071230'.

date2 = date1 + var.

write : date1 , date2.

Reward points if useful.

Regards,

Gaurav

Read only

former_member673464
Active Contributor
0 Likes
440

hi..

try this code..

<b>parameters:

p_date type d, "date

p_weeks type i. "weeks

data:

w_days type i. "days

move p_date to w_days.

w_days = w_days + ( p_weeks * 7 ) .

move w_days to p_date.

write p_date.</b>

it will give the next date required by you.

regards,

veeresh