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: 

Function module for mins to hours convertion

Former Member
0 Kudos
2,887

hi experts.

Any body can give the function module for converting minutes to HR:MM

Example if i give input 125 mins output will be 02:05 .

its an urgent...

<b>points will be rewarded for sure</b>

regards,

priynaka reddy.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,131

Hi

Try this FM

CONVERSION_EXIT_SDURA_OUTPUT

Regards

Raghav

5 REPLIES 5

Former Member
0 Kudos
1,132

Hi

Try this FM

CONVERSION_EXIT_SDURA_OUTPUT

Regards

Raghav

Former Member
0 Kudos
1,131

Hi Priyanka,

Try these FM.

CONVERSION_EXIT_SDURA_OUTPUT

RSSM_CONVERT_DAYSEC2TIMESTAMP

RRBA_DAYS_TO_TIMESTAMP_ADD

or try the foll code:

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,

Sunil

Former Member
0 Kudos
1,131

try FM CONVERSION_EXIT_SDURA_OUTPUT

Former Member
0 Kudos
1,131

You wouldn't need a function module for it.

Just use this code.

*Local Data
DATA: l_hours type n length 2,   " Hours
          l_mins  type n length 2,   " Minutes
          l_int     type i.                 " Variable for Type I 
* (Also, minutes should be a variable of type I)
l_int = minutes / 60.
l_hours = l_int.
clear l_int.
l_int = ( minutes mod 60 ) .
l_mins = l_int.

This will work...

Please reward points for the same..

Thanks..

Rahul

Former Member
0 Kudos
1,131

Hi Priyanka!

I hav already used this FM

CONVERSION_EXIT_SDURA_OUTPUT

It works fine.

U just have to give

INPUT as imoort parameter which should be times in minutes and u get time in hours as OUTPUT in export parameter.

Hope ur urgent requirement is fulfilled.

kindly reward points!!