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

time difference

Former Member
0 Likes
974

Dear All,

How can i calculate the difference between times

lv_start = 10:25:30

lv_end = 10:50:30

Now i want the output in the same time format i.e Duration = 00:25:00

How can i get this?

Regards

shoban

1 ACCEPTED SOLUTION
Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
900

Hi,

Just declare a variable

data: x like SY-UZEIT.

x = lv_start - lv_end.

I think this will serve the purpose.

Regards

Vadi

6 REPLIES 6
Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
901

Hi,

Just declare a variable

data: x like SY-UZEIT.

x = lv_start - lv_end.

I think this will serve the purpose.

Regards

Vadi

Read only

amit_khare
Active Contributor
0 Likes
900

Refer these FMs -

/SDF/CMO_TIME_DIFF_GET

TIMECALC_DIFF

SCSM_TIME_DIFF_GET

SCOV_TIME_DIFF

SRET_TIME_DIFF_GET

Regards,

Amit

Read only

Former Member
0 Likes
900

Check this FM 'L_MC_TIME_DIFFERENCE'

Read only

Former Member
0 Likes
900

data : lv_start(10), lv_end(10), H1(5),M1(5),S1(5),H2(5),M2(5),S2(5).

data : H type I,M type I,S type I.

lv_start = '10:25:30'.

lv_end = '10:50:30'.

H1 = lv_start+0(2).

M1 = lv_start+3(2).

S1 = lv_start+6(2).

H2 = lv_end+0(2).

M2 = lv_end+3(2).

S2 = lv_end+6(2).

H = H2 - H1.

M = M2 - M1.

S = S2 - S1.

write : / H,':',M,':',S.

This code only for this one, if we give lv_end 01:30:12 like this may not gives correct result

Read only

Former Member
0 Likes
900

hi

good

check this

L_MC_TIME_DIFFERENCE - Calculate time difference in minutes

thanks

mrutyun^

Read only

Former Member
0 Likes
900

Hi

Shoban babu

data:

w_temp type i,

w_diff like sy-uziet.

w_temp = lv_end - lv_end.

w_diff = w_temp.

write: / w_diff.

it is more thewn enough plzz reward if it usefull

for any furthere quiries mu mail id mutyalasunilkumar@gmail.com

plzz dont forget to reward........