Skip to Content
Former Member

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

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.

##### Add a comment
10|10000 characters needed characters exceeded

### 4 Answers

• Former Member
Posted on Mar 29, 2008 at 12:32 PM

Try these FM.

RSSM_CONVERT_DAYSEC2TIMESTAMP

RRBA_DAYS_TO_TIMESTAMP_ADD

Regards,

Chandru

##### Add a comment
10|10000 characters needed characters exceeded
• Posted on Mar 29, 2008 at 12:38 PM

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.

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member
Posted on Mar 29, 2008 at 12:39 PM

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

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member
Posted on Mar 29, 2008 at 12:40 PM

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.

##### Add a comment
10|10000 characters needed characters exceeded

### Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.