11-15-2006 3:32 AM
Dear all .
Is there any function module which gives the difference in time .
eg : time1 = 12:30:00
time2 = 13:10:00 .
difference is 40min .
thanks in advance .
11-15-2006 3:42 AM
Hi raghvendra,
check this FM CCU_TIMESTAMP_DIFFERENCE
This will give u in seconds
say in the example given by u the diff is 40 sec
for the same it will give u 2400
it means 2400/60 = 40 min
Hope this will help u
Suresh.
Message was edited by:
suresh B
11-15-2006 3:43 AM
Hi Ragh,
Check this FM CCU_TIMESTAMP_DIFFERENCE
Hope this will help u
Suresh
11-15-2006 3:43 AM
just subtract the 2 times , no need of any FM
diff = t2 - t1 , this will give in seconds , divide by 60 to get minutes
or check this FM SD_DATETIME_DIFFERENCE
11-15-2006 3:51 AM
Initiallly Check whether t2 > t1....
Now, declare a varaible T3 as type Time.
T3 = t2 - t1.
declare variable t4 as type N.
t4 = (t3+0(2) * 60) + (t3+2(2)) + (t3+4(2) / 60).
11-15-2006 3:54 AM
hi raghavendra,
try this FM L_MC_TIME_DIFFERENCE, this gives time difference with the unit.
eg : time1 = 12:30:00
time2 = 13:10:00 .
difference is 40min .
regards,
Balasubramanian .S
11-15-2006 4:05 AM
Hi,
use the FM:
<b>SD_DATETIME_DIFFERENCE</b>
It gives the difference in Days and Time for 2 dates.
Hope it helps.
Reward if helpful.
Regards,
Sipra
11-15-2006 7:17 AM
HI ,
jsut execute this code ..
data : p_stdat LIKE LTAK-BDATU,
p_endat LIKE LTAK-BDATU,
p_sttime LIKE LTAK-BZEIT,
p_endtime LIKE LTAK-BZEIT,
DELTA_TIME LIKE MCWMIT-BE_AE,
DELTA_UNIT LIKE MCWMIT-LZEIT.
DATA: P_DIFFTIME LIKE SY-UZEIT.
p_stdat = sy-datum.
p_endat = sy-datum.
p_sttime = '123000'.
p_endtime = '131000'.
P_DIFFTIME = P_ENDTIME - P_STTIME .
WRITE:/ P_DIFFTIME.
CALL FUNCTION 'L_MC_TIME_DIFFERENCE'
EXPORTING
date_from = p_stdat
date_to = p_endat
TIME_FROM = p_sttime
TIME_TO = p_endtime
IMPORTING
DELTA_TIME = DELTA_TIME
DELTA_UNIT = DELTA_UNIT
EXCEPTIONS
FROM_GREATER_TO = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ DELTA_TIME,
DELTA_UNIT.
U can go for the Fm cause if its a date change between the intervals ..
regards,
VIjay
11-15-2006 8:42 AM
Hi,
Please use the function module DURATION_DETERMINE
This function module that takes in two dates and two times and gives you the difference in a unit of your need based on a calendar.
Regards,
Irfan Hussain
Note: Please reward point for sutiable answers.
11-15-2006 8:44 AM
Hi,
You can also use this funciton module.
DELTA_TIME_DAY_HOUR
To get the differnce between 2 dates and times
Regards,
Irfan Hussain
Note:Please reward suitable answers.
11-15-2006 8:46 AM
Hi,
Please use the function module DURATION_DETERMINE
This function module that takes in two dates and two times and gives you the difference in a unit of your need based on a calendar.
Regards,
Irfan Hussain
Note: Please reward point for sutiable answers.