12-20-2006 11:06 AM
Hello All,
can any give me logic for
(20.12.2006 at 04:30 pm) - (18.12.2006 at 10:30 am) = "how many hours".
If i want to subtract 18.12.2006 at 10:30 am. from 20.12.2006 at 04:30 pm. then i want to calculate how many hours.
or
sy-datum - (18.12.2006 at 10:30 am) = "in hours"
how to do this i want logic with example. can any give solution of this problem.
Regards.
Rajesh.
12-20-2006 11:16 AM
12-20-2006 11:21 AM
Hi
Use the following FM:
SALP_SM_CALC_TIME_DIFFERENCE
it gives the difference in seconds and you devide the same by 3600
the you get the difference time
Thanks
Shiva
12-20-2006 11:25 AM
Hi,
U can this one also :
L_MC_TIME_DIFFERENCE
this gives the time difference in Minutes.
you devide the MInutes by 60 then you will get the desired output
Thanks
Shiva
12-20-2006 11:17 AM
Do this way.
if 'pm'.
V1 = 12 + 4:30
elseif 'am'.
V1 = 4:30
endif.
date = 20.12.2006 - 18.12.2006
V3 = date * 24.
if 'pm'.
V4 = 10:30
V5 = V3 - V4 + V1.
***********************
else use SD_DATETIME_DIFFERENCE.
Message was edited by:
Ramesh Babu Chirumamilla
12-20-2006 11:18 AM
12-20-2006 11:19 AM
use this function module
/SDF/CMO_DATETIME_DIFFERENCE pass both times and dates and get the differnce
12-20-2006 11:23 AM
hey use this function module u will get time in seconds then convert to minutes or hours
SALP_SM_CALC_TIME_DIFFERENCE
Reward points if useful
Regards,
Sree
12-20-2006 11:25 AM
Hi
use the following function module.
SD_CALC_DURATION_FROM_DATETIME
gives you the time in hours.
Regards
Abdullah
Message was edited by:
Abdullah Ismail
12-20-2006 11:26 AM
u can use the Fm
L_MC_TIME_DIFFERENCE
and divide the minutes my 60 to get the hrs.
regards,
vijay
12-20-2006 12:46 PM
Hi,
You can use this function module TIMECALC_DIFF.
The TimeZone that you want in this fuction can be selected from table TTZZ according to your need.
Thanks,
Sutapa.