Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Character String and Byte String Processing →  Expressions and Functions for String Processing →  String Functions →  Description Functions for Character-Like Arguments 

charlen, dbmaxlen, numofchar, strlen - Length Functions

These length functions have an unnamed character-like argument.

Other versions: 7.31 | 7.40 | 7.54

Syntax


... func( arg ) ...

Effect

The following table shows the length functions with one 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 code has the type i for all length functions.

Function func Return Value
charlen Length of first character of arg in thecode page used: 1 for non-Unicode single-byte code; 1 or 2 for non-Unicodedouble-byte code; 1 forUnicode with simple Unicode character; 2 for Unicode withsurrogates;
dbmaxlen Maximum length of a string defined in ABAP Dictionary (RAWSTRING, SSTRING, STRING). If the stringis unrestricted, the constant abap_max_db_string_ln or abap_max_db_rawstring_ln from thetype group ABAPis returned. The latter is also returned for the predefined ABAP types string and xstring.
numofchar Number of characters in arg, where trailing blanks are not counted indata objects with fixed lengths or in data objects with the type string. If a non-Unicode double-byte code is used, a character that uses two bytes is only counted once.
strlen Number of characters in arg, where trailing blanks in data objects withfixed lengths are not counted. They are counted though in data objects with the type string.If a non-Unicode double-byte code is used, a character that uses two bytes is counted twice. The argument can be also byte-like inobsolete non-Unicode programs.


Notes

  • The arguments of the functions listed here can be also byte-like in obsolete non-Unicode programs.