Application Development 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: 

urgent: date calculation!

Former Member
0 Kudos

experts,

i have question regarding date calculations.

how can i compute l_date where l_date = three days after the present date?

do i have to use a function module for this? if yes, what function module?

thank you so much...

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

Hi see this,

parameters input_date type sy-datum.

data output_date type sy-datum.

CALL FUNCTION <b>'RP_CALC_DATE_IN_INTERVAL'</b>

EXPORTING

date = input_date

<b>days = 3</b>

months = '00'

<b>signum = '+'</b>

years = '00'

IMPORTING

calc_date = output_date.

write : 'Output DATE', output_date.

Hope ur problem is solved now.

<b>Reward points if useful</b>

Thanks & Regards

ilesh 24x7

5 REPLIES 5

Former Member
0 Kudos

try this.

data:i_date type d.

i_date = sy-datum + 3.

ferry_lianto
Active Contributor
0 Kudos

Hi,

No need to use FM to calculate date, but you can use FM RP_CALC_DATE_IN_INTERVAL (if you want).

You can do something like this.


data: wa_date like sy-datum.

wa_date = sy-datum + 3.
write: / wa_date.

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi

This is very simple

You can add or substract number of days from the field (SY-DATUM) to get the required date

data: date1 type sy-datum, date2 type sy-datum.

date2 = sy-datum + 3. (13.11.2007 + 3 )

will give you 16.11.2007

similarly if you wants 10 days back date

date1 = sy-datum - 10.

will give you 03.11.2007

Regards

Anji

former_member387317
Active Contributor
0 Kudos

Hi see this,

parameters input_date type sy-datum.

data output_date type sy-datum.

CALL FUNCTION <b>'RP_CALC_DATE_IN_INTERVAL'</b>

EXPORTING

date = input_date

<b>days = 3</b>

months = '00'

<b>signum = '+'</b>

years = '00'

IMPORTING

calc_date = output_date.

write : 'Output DATE', output_date.

Hope ur problem is solved now.

<b>Reward points if useful</b>

Thanks & Regards

ilesh 24x7

Former Member
0 Kudos

hi...

thank you very much!

my problem is solved.