Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Duration Routine or Function

Former Member
0 Likes
908

Hi Everybody,

does exist a function to calculate a duration between two datestamps (date + time)?

Or does somebody know where to find a ABAP routine that do that?

Thanks in advance

FedeX

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
839

FM: SD_DATETIME_DIFFERENCE looks fine, but its not giving an accurate time difference.

7 REPLIES 7
Read only

Former Member
0 Likes
840

FM: SD_DATETIME_DIFFERENCE looks fine, but its not giving an accurate time difference.

Read only

0 Likes
839

try this coding.

GET TIME STAMP FIELD w_start_time.

write 😕 w_start_time.

do 10000 times.

write 😕 'A'.

enddo.

GET TIME STAMP FIELD w_end_time.

write 😕 w_end_time.

w_fin_time = w_end_time - w_start_time.

write /: w_fin_time.

My system gave this output :

20,060,418,101,921.9050000 (20060418 101921905)

20,060,418,101,922.0300000 (20060418 101922030)

-


difference 0.1250000 (milli seconds)

-


<b>refer weblog...

/people/horst.keller/blog/2004/11/29/abap-geek-8-150-summertime-blues-133

Read only

Former Member
0 Likes
839

Hi,

You can use the Function Module SXMS_TIMEDIFF_SEC. It gives the difference in Seconds from which you can calculate.

Thanks & Regards,

YJR

Read only

Former Member
0 Likes
839

Is this work for you DAYS_BETWEEN_TWO_DATES ?

Read only

Former Member
0 Likes
839

BINGO!! i got the perfect Function module.

SCOV_TIME_DIFF

Read only

Former Member
0 Likes
839

Hi,

You can try this FM <b>C14B_DATE_TIME_COMPARE</b>

Regards

vijay

Read only

Former Member
0 Likes
839

Hi,

Use FM CCU_TIMESTAMP_DIFFERENCE to find difference between date + time

Sameena