‎2007 Mar 28 10:51 AM
Hi all,
Is there any function module to calculate difference between two dates/times which are in TIMESTAMPL format.
I need to know how many millisconde(second,minutes, hours... )there is between these two times.
Please, It is urgent
Thank you all.
Karim
‎2007 Mar 28 10:54 AM
Try this FM
SD_DATETIME_DIFFERENCE
or
SD_CALC_DURATION_FROM_DATETIME
Regards,
Ram
reward points if helpful
Message was edited by:
Ram Mohan Naidu Thammineni
Message was edited by:
Ram Mohan Naidu Thammineni
‎2007 Mar 28 10:54 AM
hi,
To find differance between two dates....
use FM...
<b>HR_HK_DIFF_BT_2_DATES</b>
this will give you differance between times in any format means...days, days and months, days months years, only years, only months etc.. based on ouput paramter u pas sto this FM.
and make sure that the dates that you pass DATE1 should b greater than DATE2 otherwise it will give an error dump.
other than this you can use FM...
<b>SD_DATETIME_DIFFERENCE</b> also...whish will give you the differance between date and time too.
<b>Reward points for helpful answers,</b>
Regards,
Tejas
‎2007 Mar 28 11:00 AM
hi,
try n use:
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
all the best!!
Regards,
Aparna
‎2007 Mar 28 11:12 AM
Thank you guys.
But I need a FM module wich take 2 parameters (TIMESTAMPL with milliseconde) and return the differences.
example : timestampl1 = 20070328120950,123
timestampl2 = 20070328131051,124
result = 01:01:1,001
Could anyone help me?
regards
Karim
‎2007 Mar 28 11:25 AM
hi,
try the following function
CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
EXPORTING
timestamp1 = timestamp1
timestamp2 = timestamp2
IMPORTING
difference = diff
EXCEPTIONS
OTHERS = 1.
the above function gives the difference in seconds...
try the following code to set the resolution to milliseconds..
SET RUN TIME CLOCK RESOLUTION LOW
check the thread for details:
all the best!!!
Regards,
Aparna
‎2007 Mar 28 11:16 AM
Hi Karim,
You can use this function module:
CCU_TIMESTAMP_DIFFERENCE
this takes 2 time stamp as input and returns the difference.....
Thanks and Regards,
Kunjal Patel
‎2007 Mar 28 11:37 AM
hi,
the following fm may also help..
TIMECALC_DIFF
SCSM_TIME_DIFF_GET
SCOV_TIME_DIFF
SRET_TIME_DIFF_GET
all the best!!
Aparna