‎2006 Dec 15 2:33 PM
Hello,
I need to read a file *.txt that have a field with the value '1230'.
In my program i need to convert these field to a similar one like '12.30'
Is there a easy way to do that or do i need to use concatenate?
Thanks in advance.
Best regards.
‎2006 Dec 15 2:52 PM
data : cdat(10) type c value '1230',
final type p decimals 2.
final = cdat / 100.
write:/ final.check this.
do the operation in ur itab with the same ,
hope this helps ..
regards,
vijay
Message was edited by:
Vijay
‎2006 Dec 15 2:39 PM
divide that number by 100
v_num = 1230 / 100.
Not sure if this is ur requirement
‎2006 Dec 15 2:42 PM
Hi,
I don't think concatenate will serve your purpose.
Try using SHIFT operator & write each digit into another field by inserting a decimal point at desired place.
or divide by 100 & concatenate the quotient with the remainder with a decimal point.
null
‎2006 Dec 15 2:44 PM
Hi,
1) Upload the .txt file into an internal table.
2) Read table i_tab with Key field = '1230'.
3) Pass this value in a variable ws_var = i_tab-field
4) Divide the number by 100. <b>ws_var1 = ws_var/100.</b>
You can use SEARCH statement also.. Do F1 on SEARCH in Se38 and learn more.
Hope this helps.
Manish
‎2006 Dec 15 2:52 PM
data : cdat(10) type c value '1230',
final type p decimals 2.
final = cdat / 100.
write:/ final.check this.
do the operation in ur itab with the same ,
hope this helps ..
regards,
vijay
Message was edited by:
Vijay
‎2006 Dec 15 3:23 PM