Application Development 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: 

Problem in friction of time

Former Member
0 Kudos

Differance b/w two time with friction of second also.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

My Problem is not resoved now becuase given funciton is not returns in friction of Second.

7 REPLIES 7

former_member787646
Contributor
0 Kudos

Hi,

Try the Function Module "L_MC_TIME_DIFFERENCE" and check.

Hope this would help you.

Murthy

Former Member
0 Kudos

My Problem is not resoved now becuase given funciton is not returns in friction of Second.

0 Kudos

hi Ram,

if your question is not solved, than why is marked as answered?

On the other hand you can calculate the difference in seconds between two times the following way:

DATA : time1 TYPE sy-uzeit,
       time2 TYPE sy-uzeit,
       diff  TYPE i.

time1 = '180000'.
time2 = '180500'.

diff = time2 - time1.

diff will 300 in this case.

hope this helps

ec

0 Kudos

I want answer like this

if time is hh:mm:ss.

Dif :

Time1 = 10.50.45

Time2 = 12.10.10

-


Result should be 02.40.35

matt
Active Contributor
0 Kudos

Ram

That makes NO sense.

To follow your logic would mean that

Time1 = 10.50.00

Time2 = 11.00.00

diff = 01.50.00 which just doesn't mean anything. The difference between those two times is 10 minutes, not one hour fifty. Why do want to calculate like this?

and btw, it's fraction, not friction.

0 Kudos

I create a small routine for you:

DATA : time1 TYPE sy-uzeit,
       time2 TYPE sy-uzeit,
       diff  TYPE i,
       hour(2)  TYPE n,
       min(2)   TYPE n,
       sec(2)   TYPE n,
       diff2 TYPE sy-uzeit.

time1 = '105045'.
time2 = '121010'.

diff = time2 - time1.

hour = diff DIV 3600.
diff  = diff MOD 3600.
min = diff DIV 60.
sec = diff MOD 60.

CONCATENATE hour min sec INTO diff2.

however the result is different than yours. You just simply subtracted the seconds/minutes/hours from each other, which is wrong.

0 Kudos

Sorry for that meaning of calclulation and also for spelling mistake