06-05-2008 11:13 AM
Hi,
i have fields type char10 and i wont to move it to field type P dec2 i wont that the last to numbers be residue.
e.g.
char10
123456
p dec2
1234.56
i don't wont to use concatenate what is the best way to do that?
Regards
06-05-2008 11:24 AM
hi,
I guess you got to use the conctenate statement to achieve the same ..
i.e,
data : v_char(6) value '123456',
v_char_o(10),
v_p type p decimals 2.
concatenate v_char+0(4) v_char+4(2) into v_char_o separated by '.'.
move v_char_o to v_p.
write : v_p.
06-05-2008 11:24 AM
hi,
I guess you got to use the conctenate statement to achieve the same ..
i.e,
data : v_char(6) value '123456',
v_char_o(10),
v_p type p decimals 2.
concatenate v_char+0(4) v_char+4(2) into v_char_o separated by '.'.
move v_char_o to v_p.
write : v_p.
06-05-2008 11:27 AM
Hi Santosh Kumar Patha,
thanks but i don't wont to use concatenate maybe i can use MASK for this?
Regards
06-05-2008 11:33 AM
hi,
But what is the problem that you are facing using concatenate statement ???
Regards,
Santosh
06-05-2008 11:40 AM
Hi Santosh Kumar P... ,
i don't have any problem with concatenate but i wont to now if there is another way to do that and How?
Regards
06-05-2008 11:48 AM
06-05-2008 12:01 PM
06-05-2008 11:41 AM
hi cosmo,
try this
report test.
data:
v_char(10) type c,
v_dec type p decimals 2.
start-of-selection.
v_char = '123456'.
move v_char to v_dec.
divide v_dec by 100.
message i999(z0) with v_dec.
regards,
Peter
06-05-2008 12:36 PM
06-06-2008 6:54 AM
hi,
you can use this code
write v_char using edit mask '____.__'.
Note: This code has limitations. On this sample code, it is assumed that your string only contains 6 characters for display. If you have 7 characters, the last character is disregarded.
regards,
Peter