Application Development 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: 

About exception class CX_TPDA_SYS_SYMB_FSUNASSIGNED

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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é

2 REPLIES 2

Former Member
0 Kudos

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é

Former Member
0 Kudos

Thanks Mark's reply