09-23-2005 7:00 PM
I have a field of type sy-uzeit. Ex: 073000.
I need to convert it into hours, i.e. 7.5
any ideas please?
Thanks
Gova
09-23-2005 7:07 PM
Try This
data: time type sy-uzeit value '073000'.
data TIMEC(6).
data h1 type P DECIMALS 1.
data h2 type P DECIMALS 1.
data h3 type P DECIMALS 1.
data hours type P DECIMALS 1.
move time to timeC.
MOVE TIMEC(2) TO H1.
MOVE TIMEC+2(2) TO H2.
MOVE TIMEC+4(2) TO H3.
hours = h1 + ( h2 / 60 ) + ( H3 / 3600 ).
write:/ hours.
09-23-2005 7:07 PM
Try This
data: time type sy-uzeit value '073000'.
data TIMEC(6).
data h1 type P DECIMALS 1.
data h2 type P DECIMALS 1.
data h3 type P DECIMALS 1.
data hours type P DECIMALS 1.
move time to timeC.
MOVE TIMEC(2) TO H1.
MOVE TIMEC+2(2) TO H2.
MOVE TIMEC+4(2) TO H3.
hours = h1 + ( h2 / 60 ) + ( H3 / 3600 ).
write:/ hours.
09-23-2005 7:11 PM
This ignores the seconds. The hours are in 24 hour format.
DATA: v_tims LIKE sy-uzeit,
v_hrs TYPE p decimals 1.
START-OF-SELECTION.
v_tims = sy-uzeit.
v_hrs = v_tims+0(2) + ( v_tims+2(2) / 60 ).
WRITE: v_hrs.