Application Development 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: 

Moving Type Quan val to Char

Former Member
0 Kudos

Hi,

How can we move value from a Quantity field to Char field.

Regards

Ahasan

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

move v_quan to v_char. "v_char must be of suffuent length.

write v_quan to v_char. " This will also do.

8 REPLIES 8

former_member181962
Active Contributor
0 Kudos

move v_quan to v_char. "v_char must be of suffuent length.

write v_quan to v_char. " This will also do.

0 Kudos

Hi,

quan field is of length 13 .So what should be the ideal length of char field.

ahasan

Former Member
0 Kudos

Hi,

yes you can. But the character field should be long enough (equal to or more than the output length of the quan field).

Thanks

Satya

abdul_hakim
Active Contributor
0 Kudos

Hi Mohamed..

here is the example.

data menge like eket-menge." or define any quantity field

data char(13) type c.

menge = '10.00'.

move menge to char.

write char.

Cheers,

Abdul

Reward Points for all useful answers....

Former Member
0 Kudos

Hi Mohammed,

Take a character field of length which can acccomdate Quantity field and use Move statement.

data: v_quauntity type konp-kbetr,

v_quan_char(11) type c.

<b>move v_quauntity to v_quan_char. (or)

v_quan_char = v_quauntity (or)

write v_quauntity to v_quan_char.</b>

But assignment of char value consists of quantity field into Quantity field is gives you error.

Thanks,

Vinay

0 Kudos

Hi,

My Fields are

Data : v_lotszm type /sapapo/bstmi.

  • data element of type Quan length 13

Data : c_var(40) type C.

SELECT SINGLE bstmi

FROM /sapapo/matlotsz

INTO v_lotszm

WHERE lszid = v_lszid.

move v_lotszm to c_var.

But this is not working.

regards

Ahasan

0 Kudos

hi

u define your field with ref to the table field rather than with the data element.

Abdul

0 Kudos

Hi Mohammed,

first chk if data is getting selected into ur field.put a breakpoint at ur select statem,ent n c the value of sy-subrc after the select statement..if value is there, then

no problem...

declare like this

data : v_lotszm like /sapapo/matlotsz-bstmi for the quantity field n proceed.

Hope it helps,

Regards,

Bikash