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

function module to find time difference

Former Member
0 Likes
2,851

Can any body help me to find the function module to find the time diff: between two times, time is in 24hrs

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,039

Hi again,

1. Difference is always returned in SECONDS.

2. use this code (just copy paste in new program)

REPORT abc.

data : t1 type sy-uzeit.

data : t2 type sy-uzeit.

DATA : DIFF TYPE I.

t1 = '090000'.

t2 = '100000'.

DIFF = T2 - T1.

WRITE 😕 DIFF.

regards,

amit m.

5 REPLIES 5
Read only

Lakshmant1
Active Contributor
0 Likes
1,039

Hi Baiju,

Check FM,

IB_CONVERT_INTO_TIMESTAMP

IB_CONVERT_FROM_TIMESTAMP

Thanks

Lakshman

Read only

Former Member
0 Likes
1,039

Hi baiju,

1. Use :

t1 - t2.

regards,

amit m.

Read only

Former Member
0 Likes
1,040

Hi again,

1. Difference is always returned in SECONDS.

2. use this code (just copy paste in new program)

REPORT abc.

data : t1 type sy-uzeit.

data : t2 type sy-uzeit.

DATA : DIFF TYPE I.

t1 = '090000'.

t2 = '100000'.

DIFF = T2 - T1.

WRITE 😕 DIFF.

regards,

amit m.

Read only

0 Likes
1,039

TIMECALC_DIFF

SD_DATETIME_DIFFERENCE

SRET_TIME_DIFF_GET

Read only

Former Member
0 Likes
1,039

When calculating the difference in time, you always have to take the date into account; otherwise, you can end up with a negative difference.

Rob