2007 Feb 06 2:41 PM
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.
2007 Feb 06 2:50 PM
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
2007 Feb 06 2:48 PM
Declare <b>w_nro</b> as type I, that should fix your program -:)
Greetings,
Blag.
2007 Feb 06 2:49 PM
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
2007 Feb 06 2:50 PM
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
2007 Feb 06 3:09 PM
Enzo, what kind of write or code do I have to put after de carch before I endtry? I don´t understand.
2007 Feb 06 3:25 PM
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.
2007 Feb 06 2:50 PM
Hi,
w_nro contains 'X' instead of numeric value...and therefore it can not be converted to w_sum_impar format (I)....
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |