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: 

Convert Char to Quantity

Former Member
0 Kudos

Hello All,

I have to Convert Character field to a Quantity field.

Ex:

G_F_CHAR = '123456,789'.

Here G_F_CHAR is a character type and length is 10.

I want this value into G_F_QUAN ( like G_F_QUAN = 123456,789), where G_F_QUAN is a quantity field with 3 decmals.

Is there any function module to convert like this.

Thanks in advance.

Best Regards,

Sasidhar Reddy Matli.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sasidhar,

Use the following code.

data : g_f_char(10) type c,

g_f_quan type resb-bdmng,

g_f_temp(8) type p.

g_f_char = '123456789'.

g_f_temp = g_f_char.

g_f_quan = g_f_temp.

WRITE : g_f_char,

/ g_f_quan.

Regards

Alok Vishnoi

4 REPLIES 4

Former Member
0 Kudos

check these thread

madan_ullasa
Contributor
0 Kudos

Hi,

Remove all the ',' from the character string... Then have a variable of type p , decimals 3...

assign this g_f_char to that variable....

should solve your issue...

regards,

madan..

Former Member
0 Kudos

Hi Sasidhar,

Use the following code.

data : g_f_char(10) type c,

g_f_quan type resb-bdmng,

g_f_temp(8) type p.

g_f_char = '123456789'.

g_f_temp = g_f_char.

g_f_quan = g_f_temp.

WRITE : g_f_char,

/ g_f_quan.

Regards

Alok Vishnoi

Former Member
0 Kudos

Problem solved with you tips.

Thanks for your replies .