11-03-2007 12:15 PM
Can any tell me how to use this exception class.
I try to use this exception class to catch unassign exception when using field symbol. But failed.Is there a way to catch unassign exception of field symbol?
Thanks
DATA: int TYPE I.
FIELD-SYMBOL: <int> TYPE I.
DATA: r_exception TYPE REF TO CX_TPDA_SYS_SYMB_FSUNASSIGNED.
TRY.
<int> = 1.
CATCH CX_TPDA_SYS_SYMB_FSUNASSIGNED INTO r_exception.
ENDTRA.
When execute <int> = 1.ABAP dumps occurs.
11-03-2007 2:22 PM
Hi Chris,
it seems that the exception of using an unassigned field symbol is not catchable. I've tried out your example and replaced the class after CATCH statement with main exception class cx_root. Even cx_root is not able to catch this exception.
I recommend that you avoid this situation by using code like this:
IF <int> IS ASSIGNED.
<int> = some_value.
ELSE.
RAISE EXCEPTION your_exception.
ENDIF.
Hope this helps!
Regards
Mark-André
11-03-2007 2:22 PM
Hi Chris,
it seems that the exception of using an unassigned field symbol is not catchable. I've tried out your example and replaced the class after CATCH statement with main exception class cx_root. Even cx_root is not able to catch this exception.
I recommend that you avoid this situation by using code like this:
IF <int> IS ASSIGNED.
<int> = some_value.
ELSE.
RAISE EXCEPTION your_exception.
ENDIF.
Hope this helps!
Regards
Mark-André
11-04-2007 5:21 AM