2005 Nov 28 2:02 PM
Hi Every one ,
Could any one say me how could i convert the time format
for ex: i am getting a .txt file and the time defined is
09:57 and internally system is taking as <b>9::57</b>
Regards.
2005 Nov 28 2:06 PM
2005 Nov 28 2:14 PM
yes at my database level i have taken data type as TIM of 6 char but when i am uploading data from a .txt file system is also taking ':' as a charecter and storing as
<b>9::57</b>
2005 Nov 28 2:20 PM
Here is some code.
report zrich_0001.
data: time_from_file(10) type c value '9:57'.
data: internal_time type sy-uzeit.
data: hours(2) type c.
data: minutes(2) type c.
split time_from_file at ':' into hours minutes.
if hours < 10.
shift hours right deleting trailing space.
hours+0(1) = 0.
endif.
concatenate hours minutes '00' into internal_time.
write:/ internal_time.
Regards,
Rich Heilman
2005 Nov 28 2:27 PM
ot try that:
DATA time TYPE sy-uzeit.
DATA time4(4).
DATA txt(10).
txt = '9::57'.
WHILE txt CA ':'.
REPLACE ':' WITH space INTO txt.
ENDWHILE.
CONDENSE txt NO-GAPS.
UNPACK txt TO time4.
MOVE time4 TO time.
Andreas
2005 Nov 28 2:34 PM
Hi Andreas,
Thanks i have done this way
REPLACE ':' WITH '' INTO str_if-begzt.
CONDENSE str_if-begzt NO-GAPS.
but now i have one more problem i have a field that gives me a total time i am a bit confused wat data type should i declare at Dictionary ...
luk at the record
total begtime endtime
0.98 08:59 09:58
Regards
2005 Nov 28 2:50 PM
Hi,
use a variable type p decimals 2 for total (qty)
e.g. : TISTD
unit = hours
Andreas