CONVT_NO_NUMBER¶
Unable to interpret "X" as a number.
A classic ABAP runtime error: you tried to move a string into a numeric field, but the string contains characters that aren't digits.
Symptom¶
ST22 shows:
Runtime Errors CONVT_NO_NUMBER
Exception CX_SY_CONVERSION_NO_NUMBER
Short text Unable to interpret "ABC" as a number.
The dump points to a line that assigns or computes with a string value.
Cause¶
ABAP implicitly converts character types to numeric types when you assign one to the other. If the source string contains anything other than digits (and an optional leading sign or decimal separator), the runtime gives up and throws this dump.
Common triggers:
- Reading a field from a flat file (CSV, Excel) where one row has a header value or stray text in a numeric column.
- User input from a screen field where the dictionary type is
CHARbut the variable receiving it isINT4,P,F, etc. - String concatenation that accidentally pulls in spaces or letters before a numeric conversion.
- Decimal/thousand separators that don't match the user's locale (
1,234.56vs1.234,56).
Reproduce¶
DATA lv_amount TYPE p DECIMALS 2.
DATA lv_input TYPE string VALUE 'ABC'.
lv_amount = lv_input. " <-- dumps here
Fix¶
Validate the string before assigning it. Two clean approaches:
For locale-sensitive numbers (commas, dots), use CONVERT_STRING_TO_AMOUNT or normalise the separator yourself:
Prevention¶
- When reading external data (file, BAPI, web service), never trust the input — validate every numeric column.
- Skip header rows explicitly when parsing CSV/Excel uploads.
- For user input, define screen fields with the correct dictionary type so the framework converts and validates for you.
- Wrap risky conversions in
TRY ... CATCH cx_sy_conversion_no_numberand log the offending row so the user knows which record failed.
See also¶
CX_SY_CONVERSION_NO_NUMBER— exception class- SAP Help — Conversions Between Data Types