Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Convert decimal hours into hh:mm:ss format

I want to convert decimals hours into hh:mm:ss

i.e. 1.38 into 1:22:48

please give me any function module or

is there any formula

Tags:
Former Member
replied

in simplerway you can do this..

REPORT  ztest_time_conv.

DATA: hour(2) TYPE n,
      min(2) TYPE n,
      sec(2) TYPE n,
      tim TYPE i.
DATA: time TYPE p DECIMALS 2.
DATA: timeformat TYPE sy-uzeit.
time = '1.38'.

tim = time * 3600.
hour = tim DIV 3600.
tim = tim MOD 3600.
min = tim DIV 60.
sec = tim MOD 60.


CONCATENATE hour min sec INTO timeformat.
WRITE timeformat.
BREAK-POINT.

2 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question