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

CX_SY_CONVERSION_NO_NUMBER

Former Member
0 Likes
1,556

Hi,

I´m trying to prin a Form and it throws the following dump:

**********************************************************************************************

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMB

caught in

procedure "OBTENER_COD_BARRA" "(FORM)", nor was it propagated by a

clause.

Since the caller of the procedure could not have anticipated that t

exception would occur, the current program is terminated.

The reason for the exception is:

The program attempted to interpret the value "X" as a number, but

since the value contravenes the rules for correct number formats,

this was not possible.

**********************************************************************************************

data

w_sum_impar type i,

w_sum_par type i,

w_nro,

w_barra_aux(39) TYPE c,

wa_barra39(39) TYPE c,

271 MOVE: j_1apacd-j_1apac TO wa_pracd,

272 j_1apacd-j_1apacvd TO wa_ent-value.

273

274

275 MOVE wa_ent-value TO wa_vdpcd.

276

277 *concatenamos los valores necesarios

278 CONCATENATE wa_cuit wa_j_1aoftp wa_xblnr+0(4)

279 wa_pracd wa_vdpcd

280 INTO wa_barra39.

281

282 * Obtener el dígito verificador.

283 CLEAR: w_pos,

284 w_nro,

285 w_sum_impar,

286 w_sum_par,

287 w_sum_total,

288 w_ultimo,

289 w_dig_ver.

290

291 w_barra_aux = wa_barra39.

292

293 DO 39 TIMES.

294

295 w_nro = w_barra_aux+0(1).

296 w_pos = sy-index.

297 w_pos = w_pos MOD 2.

298

299 IF w_pos = 1.

300 *Acumulamos los valores de las posiciones impares.

>>>> w_sum_impar = w_sum_impar + w_nro.

302 *Acumulamos los valores de las posiciones pares.

303 ELSE.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,165

Ciao Lucila,

you can avoid the dump using a try catch statment.


data ex type ref to CX_SY_CONVERSION_NO_NUMB.
try.
w_sum_impar = w_sum_impar + w_nro. 
catch CX_SY_CONVERSION_NO_NUMB into ex.
catch.
**Put here some code to manage the error. For example a write, or a pop-up or exit
** from the program.
endtry.

The reason because you have an 'X' in your field w_nro (I think it is this one) depend on the initial concatenate.

I hope this can help u.

Bye

Ciao Lucila,

you can avoid the dump using a try catch statment.


data ex type ref to CX_SY_CONVERSION_NO_NUMB.
try.
w_sum_impar = w_sum_impar + w_nro. 
catch CX_SY_CONVERSION_NO_NUMB into ex.
catch.
**Put here some code to manage the error. For example a write, or a pop-up or exit
** from the program.
endtry.

The reason because you have an 'X' in your field w_nro (I think it is this one) depend on the initial concatenate.

I hope this can help u.

Bye

6 REPLIES 6
Read only

Former Member
0 Likes
1,165

Declare <b>w_nro</b> as type I, that should fix your program -:)

Greetings,

Blag.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,165

You must make sure that the fields w_sum_impar and w_nro only have numbers in them, there can be no thousands separator such as 1,234.00, it must be 1234.00. If you are seeing commas in the values, you can get rid of them by using TRANSLATE

Translate w_sum_impar using ', '.  
condense w_sum_impar no-gaps.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,166

Ciao Lucila,

you can avoid the dump using a try catch statment.


data ex type ref to CX_SY_CONVERSION_NO_NUMB.
try.
w_sum_impar = w_sum_impar + w_nro. 
catch CX_SY_CONVERSION_NO_NUMB into ex.
catch.
**Put here some code to manage the error. For example a write, or a pop-up or exit
** from the program.
endtry.

The reason because you have an 'X' in your field w_nro (I think it is this one) depend on the initial concatenate.

I hope this can help u.

Bye

Read only

0 Likes
1,165

Enzo, what kind of write or code do I have to put after de carch before I endtry? I don´t understand.

Read only

0 Likes
1,165

In general if the program is an executable report you can insert a write statment, and continue the report, or insert a popup to inform for the error end exit the program without a dump. It depends on your application. You can fill with zero the field are you summing or perform any action you need in this situation.

Read only

Former Member
0 Likes
1,165

Hi,

w_nro contains 'X' instead of numeric value...and therefore it can not be converted to w_sum_impar format (I)....