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

Number conversion error

Former Member
0 Likes
469

Hello All,

I have the following code with me:

data:w_s1 type c,
        w_q1_act_rec1(14) type c,
        W_q LIKE EKPO-MENGE.
w_s1 = '-'.
w_q1 = '52,352.900'.
concatenate  w_s1 w_q1 into W_Q1.
condense W_Q1.
W_Q = W_Q1.

when i execute the above code I get the following short dump:

The program attempted to interpret the value "-52,352.900 " as a number, but

since the value contravenes the rules for correct number formats,

this was not possible.

the program is giving me a dump when I am insertinf w_Q1's value to W_Q.

As far as I know W_Q should hold -ve sign.

Please advise.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
437

You have to get rid of the commas and periods before you assign the character string to a number.

Rob

2 REPLIES 2
Read only

Former Member
0 Likes
438

You have to get rid of the commas and periods before you assign the character string to a number.

Rob

Read only

Former Member
0 Likes
437

Hi rajatg ,

pls try changing

w_q1 = '52,352.900'.

with

w_q1 = '52352.900'.

Edited by: gzervas on Dec 13, 2010 3:31 PM