‎2007 Jun 05 3:39 AM
Hi,
Can anybody tell me how to convert a quantity field into a charecter.
Thanks,
Mungala.
‎2007 Jun 05 3:40 AM
data a type vbak-netwr. " qty field
data b(16) type c.
start-of-selection.
a = '100.000'.
move a to b.
‎2007 Jun 05 3:40 AM
data a type vbak-netwr. " qty field
data b(16) type c.
start-of-selection.
a = '100.000'.
move a to b.
‎2007 Jun 05 3:44 AM
hi Praveena,
do this way
data : v_quant type BDMNG,
v_char(20).
* Qunat to Char conversion
v_char = v_quant.Char to Qunat conversion
use call function 'MOVE_CHAR_TO_NUM'
exporting
chr = v_char_field
importing
num = v_qty_num
exceptions
convt_no_number = 1
convt_overflow = 2.
if sy-subrc <> 0.
"write/throw error message
endif.
2)QSS0_CHAR_FLTP_CONVERSION.
‎2007 Jun 05 3:45 AM
hi praveena,
if it's at the report level,
just try this,
define one local variable i.e. data: l_char(10) type c.
move your quantity field into this local variable(l_char) and disply this.
regards,
seshu.
‎2007 Jun 05 4:05 AM
Hi if you want it to be converted to the way how it is being displayed in output (with commas) then try this:
write quan_field to char_field.
here char_field is of type char.
ex: if quan_field has value 10000.25 then char_field will have value 10,000.25