{FIRST OCCURRENCE}|{ALL
OCCURRENCES} OF defines whether all or only the first occurrence of
the search pattern is searched. If the addition FIRST OCCURRENCE
or none of the additions is specified, only the first occurrence is
found. Otherwise, all occurrences are found.
If substring is an empty string in the
pattern or is of type c , d , n , or t
and only contains blank characters, when searching for the first
occurrence, the space in front of the first character or byte of the
search range is found. If searching for all occurrences, in this case
the exception CX_SY_FIND_INFINITE_LOOP is triggered.
If regex contains a regular
expression in the pattern
that matches the empty character string, the search for one occurrence
also finds the space before the first character. When searching for all
occurrences, in this case, the search finds the space before the first
character, all intermediate spaces that are not within a match, and the
space after the last character.
ABAP_ADDITION_2 ... IN {CHARACTER|BYTE} MODE
What does it do? The optional IN {CHARACTER|BYTE} MODE addition
determines whether character
string or byte string processing is carried out. If the addition is
not specified, character string processing is carried out. Depending on
the processing type, dobj and substring in
pattern must be character-like or
byte-like. If regular expressions
are used in pattern , only character string processing is
permitted.
Runtime Exceptions
Catchable Exceptions
CX_SY_FIND_INFINITE_LOOP
Reason for error: Substring of length 0 generates an endless loop
when searching for all occurrences.
Runtime error: FIND_INFINITE_LOOP
CX_SY_RANGE_OUT_OF_BOUNDS
Reason for error: Illegal offset or length specification in the addition
of SECTION OF .
Runtime error: REFI_WRONG_SECTION
CX_SY_INVALID_REGEX
Reason for error: Illegal expression after the addition REGEX .
Runtime error: INVALID_REGEX
CX_SY_REGEX_TOO_COMPLEX
Reason for error: More information: Exceptions
in Regular Expressions .
Runtime error: REGEX_TOO_COMPLEX
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved