‎2007 Jun 12 12:16 PM
I want to calculate the difference ( in hours ) between two given times.
Is there any function module for this .
Thanks in advance.
‎2007 Jun 12 12:18 PM
‎2007 Jun 12 12:19 PM
HI,
check for the function module
/SDF/CMO_TIME_DIFF_GET
reward points if helpful
regards,
venkatesh
‎2007 Jun 12 12:20 PM
Hi,
Try the FM <b>'HR_TIME_AND_DURATION'</b>.
Try the Following Sample Code:
DATA : lv_end_time TYPE uplend VALUE '140000',
lv_seconds TYPE sytabix,
lv_total_seconds TYPE sytabix,
lv_rem_seconds TYPE sytabix,
lv_temp_hours TYPE uplend.
lv_total_seconds = 5 * 60 * 60.
CALL FUNCTION 'SWI_DURATION_DETERMINE'
EXPORTING
start_date = sy-datum
end_date = sy-datum
start_time = sy-uzeit
end_time = lv_end_time
IMPORTING
duration = lv_seconds.
lv_rem_seconds = lv_total_seconds - lv_seconds.
lv_rem_seconds = lv_rem_seconds MOD 86400.
lv_temp_hours = lv_rem_seconds.
WRITE 😕 lv_temp_hours.
Regards,
Padmam.
‎2007 Jun 12 12:23 PM
Please go through the Functions Module , it gives date as well as time difference, though U may have to enter time as well.
SD_DATETIME_DIFFERENCE
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
‎2007 Jun 12 12:24 PM
hi chandru,
u can also try this fm SD_DATETIME_DIFFERENCE
Regards...
Arun.
Reward points if useful.
‎2007 Jun 12 12:39 PM
Hi,
Try the following FM
SCOV_TIME_DIFF_46B
TIMECALC_DIFF
SCSM_TIME_DIFF_GET
SCOV_TIME_DIFF
SRET_TIME_DIFF_GET
Regards