cancel
Showing results for 
Search instead for 
Did you mean: 

No exception CX_SY_CONVERSION_NO_NUMBER after using SPLIT statement

DanielB
Explorer
0 Kudos

Hello,

if I use a split statement with the semicolon as separator to get all segments of a string like "Test;10.X" and try to assign the second segment (i.e. "10.X") to an integer variable, no exception "CX_SY_CONVERSION_NO_NUMBER" is thrown. However the exception is thrown, if I use the condense function for the table term and assign it to the integer variable.

Here the example code:

 DATA lt_string TYPE STANDARD TABLE OF string.
 DATA lv_string TYPE string VALUE 'Test;10.X'.
 DATA lv_integer TYPE int4.

 SPLIT lv_string AT ';' INTO TABLE lt_string.

 TRY.
*lv_integer = condense( lt_string[ 2 ] ). "Throws exception "CX_SY_CONVERSION_NO_NUMBER"
 lv_integer = lt_string[ 2 ]. "No exception -> Just runtime error "CONVT_NO_NUMBER"
 CATCH cx_root INTO DATA(lx_root).
 WRITE 'Error'.
 ENDTRY.

We are using SAP_ABA Release 7.50 SP10.

Regards
Daniel

Accepted Solutions (0)

Answers (0)