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 conversion FM

kesavadas_thekkillath
Active Contributor
0 Likes
570

Hi..

convert 04:30:15 ( hh:mm:ss )

as

4.51 ( ie hours in fraction )

Any Fm available for this.

Keshav

4 REPLIES 4
Read only

Former Member
0 Likes
532

Hi:

Try this

DATA: l_start TYPE t,

l_end TYPE t,

l_startdate TYPE d,

l_enddate TYPE d,

l_hours TYPE p DECIMALS 2.

l_start = p_starttime.

l_end = p_endtime.

l_startdate = p_startdate.

l_enddate = p_enddate.

l_hours = ( ( l_enddate - l_startdate ) * 24

+ ( l_end - l_start ) / 3600 ).

Regards

Shashi

Read only

0 Likes
532

Hi shashi,

DATA: l_start TYPE sy-uzeit,

l_end TYPE sy-uzeit,

l_startdate TYPE sy-datum,

l_enddate TYPE sy-datum,

l_hours TYPE p DECIMALS 2.

l_start = '170456'.

l_end = '172514'.

l_startdate = '20090202'.

l_enddate = '20090202'.

l_hours = ( ( l_enddate - l_startdate ) * 24

+ ( l_end - l_start ) / 3600 ).

write l_hours.

my output is 00:20:18

ur result is 0.34

but here half n hour is not completed in my case.

Read only

Former Member
0 Likes
532

Hi,

check with the link.

Thanks,

Neelima.

Read only

Former Member
0 Likes
532

hi

try MONI_TIME_CONVERT

hope this helps

regards

Aakash Banga