ABAP for Cloud Development, ©Copyright 2021 SAP SE. All rights reserved.ABAP - Keyword Documentation → ABAP - Programming Language → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → String Functions (string_func) → string_func - Description Functions →
string_func - charlen, dbmaxlen, numofchar, strlen
These length functions have an unnamed character-like argument.
... func( arg ) ...
The following table shows the length functions with an unnamed argument. The arguments arg of all length functions except dbmaxlen are character-like expression positions. The argument of dbmaxlen is a character-like functional operand position. The return value has the type i for all length functions.
|Function func||Return Value|
|charlen||Length of the first character of arg in the code page used: 1 for a single Unicode character; 2 for surrogate pairs.|
|dbmaxlen||Maximum length of a string defined in the ABAP Dictionary (RAWSTRING, SSTRING, STRING, or GEOM_EWKB). If the string is unrestricted, the constant abap_max_db_string_ln or abap_max_db_rawstring_ln from the type pool ABAP is returned. The latter is also returned for the built-in ABAP types string and xstring.|
|numofchar||Number of characters in arg, where trailing blanks are not counted in data objects with fixed lengths or in data objects with the type string.|
|strlen||Number of characters in arg, where trailing blanks in data objects with fixed lengths are not counted, whereas in data objects with the type string they are.|