on 11-14-2018 8:22 AM
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
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.