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
char_off - Length Function
This length function has a named character-like argument.
7.31 | 7.40 | 7.54
... char_off( val = text add = pos [off = off] ) ...
The function returns the offset of the character in
text that is
places away from the character in the offset specified in
off. The default value for
off is 0.
text is a
character-type expression position.
numerical expression positions with the type
The value of
pos can be positive and negative and has the appropriate number
of places on the right or on the left. If
pos identifies a positions outside
text, the function returns the value -1. If
is greater than the length of
text, an exception of the class CX_SY_RANGE_OUT_OF_BOUNDS is raised.
char_off is suitable for finding the correct offsets of characters in non-Unicode double-byte systems.
The following call gets the offset
off in a non-Unicode double-byte system, plus the number of bytes for the character located in the position of
... char_off( val = text add = 1 off = off ) ...