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

Former Member
0 Likes
606

Hi all,

I have a field which contains the time and I need to convert it in the following way.

The time Unit is HOURS and it is a quantity firld.

if i have the time value as 4.0 hours, my requirement is to display it as +000400 hours.

If I have the time as 0.25 hours then I need to make it as +000025 hours.

it is urgent.

Thanks&Regards,

Mungala.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
525

data : v_time type sy-uzeit.

data : i_final(10) type c.

start-of-selection.

v_time = sy-uzeit.

concatenate '+000' v_time into i_final.

write i_final.

3 REPLIES 3
Read only

Former Member
0 Likes
525

HI

Multiply the hours field by 100.

using string concatenate function add + to ur result and move it to another variable.

write the variable.

I hope this will slove ur problem.

Need ur reward points

Regards

Ravi

Read only

Former Member
0 Likes
526

data : v_time type sy-uzeit.

data : i_final(10) type c.

start-of-selection.

v_time = sy-uzeit.

concatenate '+000' v_time into i_final.

write i_final.

Read only

former_member196280
Active Contributor
0 Likes
525

data : time(6) type n.

time = '4.00'. "output 000400

time = '0.25' "output 000025

Reward points if useful.

Regards,

SaiRam