Skip to Content

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

convert quantity field to timestamp


I want to convert the quantity field to timestamp. for e.g.

I have value in quantity field as 1.6 . That I want to convert to 1hr36 minutes.

Is there any FM to do this.

Or how shall I write the code for this?

Thanks in advance,


MAdhuri S


Try this

str   TYPE char10,
n1    TYPE p DECIMALS 2,
n2(2) TYPE n,
n3    TYPE t,
n4    TYPE p DECIMALS 2,
n5(6) TYPE c,
n6    TYPE p DECIMALS 2.    .

n1      = '1.6'.    "assign your value
n6      = '60'.
n2      = trunc( n1 ).
n4      = ( n1 - n2 ) * n6 .
n5      = '000000'.
n5(2)   = n2.
n2      = n4.
n5+2(2) = n2.
n3 = n5.

WRITE n3 TO str.
WRITE: / 'Time =', str.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question