Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

type conversion

Former Member
0 Likes
584

Hi,

Can anybody tell me how to convert a quantity field into a charecter.

Thanks,

Mungala.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
560

data a type vbak-netwr. " qty field

data b(16) type c.

start-of-selection.

a = '100.000'.

move a to b.

4 REPLIES 4
Read only

Former Member
0 Likes
561

data a type vbak-netwr. " qty field

data b(16) type c.

start-of-selection.

a = '100.000'.

move a to b.

Read only

Former Member
0 Likes
560

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.

Read only

Former Member
0 Likes
560

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.

Read only

Former Member
0 Likes
560

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