‎2007 Jul 02 2:48 PM
hi guys
I have to calculate date like this
dat1 = 20070706.
date2 = dat1 + 365 * 5.5.
So i would like to know in date2 field do I get 5.5yrs later date?
‎2007 Jul 02 2:52 PM
‎2007 Jul 02 2:54 PM
Use the FM /SAPHT/DRM_CALC_DATE
parameters:
date: date1
months:06
sign:+ (for future)
- (for back )
years:05
Award points if its useful.
Regards'
Sreenivas
‎2007 Jul 02 2:55 PM
You can also use <b>RP_CALC_DATE_IN_INTERVAL</b> You can add days, months or years -:)
Greetings,
Blag.
‎2007 Jul 02 2:55 PM
Hi,
Try like this:
REPORT ZDATEDIFF.
DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
REgards,
Bhaskar
‎2007 Jul 02 2:57 PM
Hello,
Do like this.
Parameters: date like sy-datum.
data: lv_datum like sy-datum.
data: int1 type p decimals 2.
int1 = 365 * 5.5
lv_datum = int1 + date.
write: lv_datum.VAsanth
‎2007 Jul 02 2:57 PM
Or Simply:
DATA: lv_date TYPE datum VALUE '20070101',
lv_nb_days TYPE i.
lv_nb_days = 365 * '5.5'.
lv_date1 = lv_date1 + lv_nb_days.
WRITE: / lv_date1.
‎2007 Jul 02 2:58 PM
data d1 like sy-datum.
d1 = '20070706'.
d1 = d1 + 365 * 5 + 365 div 2.
write d1.
‎2007 Jul 02 2:58 PM
HI,
here 5.5 years means 11/2 years so do like this.
data:dat1 type sy-datum,date2 type sy-datum.
dat1 = sy-datum.
write:/ dat1.
date2 = dat1 + 365 * 11 / 2.
write:/ date2.
rgds,
bharat.
‎2007 Jul 02 3:03 PM
REPORT ychatest.
DATA : v_date LIKE p0001-begda.
v_date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = v_date
days = '00'
months = '06'
signum = '+'
years = '05'
IMPORTING
calc_date = v_date.
WRITE : v_date.
‎2007 Jul 03 3:59 AM
answers which I have got they are really helpful for me.
Thank You for all...