‎2006 Oct 29 1:21 PM
hello!
i am looking for FM to calculate number of days between dates.
I am working on 46c.
regards
yifat
‎2006 Oct 30 11:33 AM
Hi Yifat ,
u can use Function Module
HR_HK_DIFF_BT_2_DATES
to calculate the number of days between two dates ..
date1 --10302006
date2 --10112006
output format --02
o/p is 20 days
note that date 1 > date 2 in this Fm ..
regards,
Vijay.
‎2006 Oct 29 1:46 PM
Hi Yifat,
Please check this FM.
DAYS_BETWEEN_TWO_DATES
FIMA_DAYS_BETWEEN_TWO_DATES_2
FIMA_DAYS_BETWEEN_TWO_DATES
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
‎2006 Oct 29 2:42 PM
Hi,
Try this..
DATA: V_CURR_DATE TYPE SYDATUM.
DATA: V_PAST_DATE TYPE SYDATUM VALUE '20061001'.
DATA: V_DIFF TYPE INT4.
V_CURR_DATE = SY-DATUM.
V_DIFF = V_CURR_DATE - V_PAST_DATE.
WRITE: / 'Number of days - ', V_DIFF.
Thanks,
Naren
‎2006 Oct 29 3:04 PM
hi,
no need for any function module.
You can define a variable of type I and just subtract both dates.
ex:
Data: datehigh type sy-datum,
datelow type sy-datum.
data: diff type i.
datehigh = sy-datum.
datelow = sy-datum - 100. "just a sample date.
diff = datehigh - datelow.
write: diff.
rgds
anver
if helped pls mark points
‎2006 Oct 30 11:33 AM
Hi Yifat ,
u can use Function Module
HR_HK_DIFF_BT_2_DATES
to calculate the number of days between two dates ..
date1 --10302006
date2 --10112006
output format --02
o/p is 20 days
note that date 1 > date 2 in this Fm ..
regards,
Vijay.
‎2006 Oct 30 11:35 AM
you can just subtract one date from the second.(Both must be of type sy-datum).
days = date1 - date2.
Regards,
ravi
‎2006 Oct 30 11:39 AM
Use FM FIMA_DAYS_BETWEEN_TWO_DATES
Best Regards,
Vibha
*Please mark all the helpful answers