2007 Nov 13 1:38 AM
Hi all,
In our abap proxy program, sometimes the CONVT_NO_NUMBER will happen and cause the program dump. I noticed that this error cannot be caught by CX_ROOT exception class.
Some told me I can use the CATCH SYSTEM-EXCEPTIONS sentence to catch this runtime error, but it is a old-way syntax and cannot be used with the "try" and "catch".
So, how can I catch this runtime error and avoid the dump of our program?
Thanks,
YiNing
2007 Nov 13 3:14 AM
Here's a link talking about the same issue.
Not all errors are catchable, is that true?
Here's a link talking about the same issue.
Not all errors are catchable, is that true?
2007 Nov 13 1:50 AM
Hi,
Check below thread
/thread/69351 [original link is broken]
http://help.sap.com/saphelp_webas610/helpdata/en/c3/021950f06111d4b2eb0050dadfb92b/content.htm
Regards,
Atish
2023 Jan 12 2:42 PM
link not valid. SAP links and SAP forum links make no sense in case of sap, because SAP changes them all the time. Copy of original text is only solution.
2023 Jan 12 3:20 PM
17 years after, even in other forum, not sure the link on documentation survive this timelaps
2007 Nov 13 3:14 AM
Here's a link talking about the same issue.
Not all errors are catchable, is that true?
2007 Nov 13 3:17 AM
2007 Nov 13 3:51 AM
How to catch the CONVT_NO_NUMBER error in a OO ABAP program.
2007 Nov 13 3:53 AM
Have you checked the links I provided. Aren't they useful?
Regards,
Atish
2007 Nov 13 5:20 AM
Hi, Atish. The 1st link you gave me suggests that "CATCH SYSTEM-EXCEPTIONS" can be used to solve this problem. But as I said, it seems that "Catch... End Catch" cannot be used with "try...catch".
The 2nd link suggests us to use the "CX_SY_CONVERSION_NO_NUMBER" Exception Class to catch the runtime error, I did have try it and has no effect.
2007 Nov 13 5:23 AM
What is the problem with the class CX_SY_CONVERSION_NO_NUMBER. It should work,
Regards,
Atish
2007 Nov 13 6:17 AM
No, it doesn't work.
Try the follwing code:
TRY.
IF 'A' > 5.
ENDIF.
CATCH CX_SY_CONVERSION_NO_NUMBER.
ENDTRY.The program will still dump.
2007 Nov 13 6:41 AM
Hi,
You are not checking for conversion.
You are checking ofr logical expression.
Try below code, it works
DATA error_ref TYPE REF TO cx_sy_conversion_no_number.
DATA err_text TYPE string.
DATA a TYPE i.
TRY.
MOVE 'A' TO a.
CATCH cx_sy_conversion_no_number INTO error_ref.
err_text = error_ref->get_text( ).
WRITE err_text.
ENDTRY.
Regards,
Atish
2020 Jan 20 5:54 AM
use MOVE statement within TRY ... CATCH block. It will catch the run-time errors.
TRY.
MOVE 'abcd' TO lv_num.
CATCH cx_root INTO DATA(lv_cerr).
DATA(lv_mesg) = lv_cerr->get_text( ).
WRITE / lv_mesg.
CLEAR lv_num.
ENDTRY.
2024 Nov 12 8:36 AM - edited 2024 Nov 12 8:41 AM
You can also use
TRY.
numeric_variable = EXACT #( character_variable ).
CATCH cx_sy_conversion_no_number.
ENDTRY.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |