‎2005 Aug 27 7:03 AM
Hi All,
I want to calcualte the difference of two times provided
for eg : 09:46:00 PM - 09:45:00 am = 12 hrs 01 mins 00 seconds.
I have tried with a couple of standard Fms but couldn't find an appropriate one that gives me the difference in the format HH:MM:SS.
Is there any soln for this ?
Regards,
Beena
‎2005 Aug 27 9:36 AM
Hi Beena
If your problem is solved and there is no need of further inputs on this, please close the thread.
Regards
Ashish Jain
‎2005 Aug 27 8:00 AM
Hi Beena
I tried a piece of code, it works for me:
REPORT ZTEST_ASH.
data: time1 like sy-uzeit.
data: time2 like sy-uzeit.
data: time like sy-uzeit.
time1 = sy-uzeit.
time2 = '120101'.
time = time1 - time2.
write: time.
It gives me output in the format- HH:MM:SS
Here, you need to enter time1 and time 2 as: 'HHMMSS'
Regards
Ashish
‎2005 Aug 27 8:30 AM
Hi Beena
I found something else for you
If you are using your time variables of type 'T', then my previous piece of code doesn't work as you desire (it was working fine for ... like sy-uzeit), so look at the new one:
REPORT ZTEST_ASH.
data: time1 type t.
data: time2 type t.
data: time type t.
time1 = sy-uzeit. " or you can give any time
time2 = '120101'.
time = time1 - time2.
WRITE (8) TIME USING EDIT MASK '__:__:__'.
WRITE (20) TIME USING EDIT MASK '__ hrs __ min __ sec'.
I hope it will close the issue
Cheers
Ashish
‎2005 Aug 27 9:52 AM
Hi Ashish ,
Thank u very much ..it solved my problem
rgds
beena
‎2005 Aug 27 9:36 AM
Hi Beena
If your problem is solved and there is no need of further inputs on this, please close the thread.
Regards
Ashish Jain