2007 Nov 12 10:40 AM
Hi all,
I have a requirement that i am having no of days, and one date according to the date given i should display the past date depending up on the no. of days.
ex: no of days are 23.
given date is 07.08.2007.
now i should display date i.e past date 23 days before date as 16.07.2007.
The total days between two dates(including given dates) i.e 16.07.2007 to 07.08.2007 should be equal to no. of days i.e 23.
<b>useful answers will be rewarded</b>
Regards,
sunil kumar.
2007 Nov 12 10:53 AM
See the Example..
Which will solve your problem..
parameters input_date type sy-datum.
parameters input_days type i.
data output_date type sy-datum.
CALL FUNCTION '<b>RP_CALC_DATE_IN_INTERVAL</b>'
EXPORTING
<b>date = input_date</b>
<b>days = input_days</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>Rewards points if it is useful</b>
Thanks & Regards
ilesh 24x7
Hi all,
I have a requirement that i am having no of days, and one date according to the date given i should display the past date depending up on the no. of days.
ex: no of days are 23.
given date is 07.08.2007.
now i should display date i.e past date 23 days before date as 16.07.2007.
The total days between two dates(including given dates) i.e 16.07.2007 to 07.08.2007 should be equal to no. of days i.e 23.
<b>useful answers will be rewarded</b>
Regards,
sunil kumar.
2007 Nov 12 10:46 AM
use function module RP_CALC_DATE_IN_INTERVAL
Pass date
signum should be '-'.
days should be 23.
u will get required result.
2007 Nov 12 10:47 AM
hi sunil
use this fm RP_CALC_DATE_IN_INTERVAL
it's will be useful to u
kk.
2007 Nov 12 10:48 AM
hi sunil,
try this...I'm not sure...:)
DATA : date LIKE sy-datum VALUE '20070807',
no_of_days TYPE i VALUE 23.
date = ( date - no_of_days ) + 1.
WRITE : date.
2007 Nov 12 10:48 AM
2007 Nov 12 10:53 AM
See the Example..
Which will solve your problem..
parameters input_date type sy-datum.
parameters input_days type i.
data output_date type sy-datum.
CALL FUNCTION '<b>RP_CALC_DATE_IN_INTERVAL</b>'
EXPORTING
<b>date = input_date</b>
<b>days = input_days</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>Rewards points if it is useful</b>
Thanks & Regards
ilesh 24x7
2007 Nov 12 11:00 AM
Hi sunil,
you can simple substract the days:
data: date like sy-datum.
data: days type i.
date = sy-datum - 23.
days = sy-datum - date.
write: / date, sy-datum, days.
Test it.
Regards, Dieter