Ansicht
Dokumentation

ABENLENGTH_FUNCTIONS - LENGTH FUNCTIONS

ABENLENGTH_FUNCTIONS - LENGTH FUNCTIONS

rdisp/max_wprun_time - Maximum work process run time   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- charlen, dbmaxlen, numofchar, strlen

These built-in length functions have an unnamed character-like argument.

... func( arg ) ...

Effect

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 neither counted in data objects with fixed lengths nor 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.

Note

The functions listed here are some of the functions that can also be used in the obsolete extended functional operand positions if their argument is a single data object.

Example

The results of the following length determinations are 10 and 5.

Example

The result of function strlen is 2 because ABAP handles the surrogate pair in the character string as two UCS-2 characters. When counting with a regular expression in PCRE syntax that is introduced with (*UTF), the result is 1, because the surrogate pair is interpreted as one UTF-16 character.






PERFORM Short Reference   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 3881 Date: 20240423 Time: 102006     sap01-206 ( 33 ms )