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: 

Is there any FM to convert given data into hours and minutes.

Former Member
0 Kudos

Hi all,

Is there any FM to calculate given data into hours and minutes.

Suppose i have 80 it should display 1hr 20 mins

Can any body tell me ASAP.

Regards,

Sagar.

4 REPLIES 4

Former Member
0 Kudos

Try these FM.

RSSM_CONVERT_DAYSEC2TIMESTAMP

RRBA_DAYS_TO_TIMESTAMP_ADD

Regards,

Chandru

vinod_vemuru2
Active Contributor
0 Kudos

Hi Sagar,

I am not sure of FM. But u can use the logic below for ur requirement.

DATA: l_input TYPE i VALUE '80',

l_hr TYPE i,

l_min TYPE i.

l_hr = l_input DIV 60.

l_min = l_input MOD 60.

WRITE:/1 l_hr, 'hr', l_min, 'min.'.

Thanks,

Vinod.

former_member387317
Active Contributor
0 Kudos

Hi VidysSagar Reddy Sannala,

Use the function module

CONVERSION_EXIT_SDURA_OUTPUT

It accepts minutes as input and gives the hour and remaining minutes as output

e.g. You enter

for 180, you get the output as 3:00;

for 207, the output is 3:27

Hope it will solve your problem

Reward points if useful..

Thanks & Regards

ilesh 24x7

Former Member
0 Kudos

hi check this..

parameters:p_min(3) type c.

data: hours(2) type c,

min(2) type c,

c(2) type c,

d type i.

if p_min lt 60.

hours = 0.

min = p_min.

write:/ hours , 'hours' , min, 'minutes'.

else.

c = p_min mod 60 .

d = p_min / 60.

hours = 0.

min = c.

write:/ d , 'hours' , c , 'minutes'.

endif.

regards,

venkat.