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

Convert Char to Quantity

Former Member
0 Likes
4,648

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
Read only

Former Member
0 Likes
2,149

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

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
Read only

Former Member
0 Likes
2,149

check these thread

Read only

madan_ullasa
Contributor
0 Likes
2,149

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..

Read only

Former Member
0 Likes
2,150

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

Read only

Former Member
0 Likes
2,149

Problem solved with you tips.

Thanks for your replies .