ABAP Keyword Documentation → ABAP - Short Reference
FIND - Short Reference
Other versions: 7.31 | 7.40 | 7.54
Syntax
FIND [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
{[SUBSTRING] substring} | {REGEX regex} IN
{ {[SECTION [OFFSET off] [LENGTH len] OF] dobj}
| {TABLE itab [FROM lin1 [OFFSET off1]]
[TO lin2 [OFFSET off2]]} }
[IN {CHARACTER|BYTE} MODE]
[{RESPECTING|IGNORING} CASE]
[MATCH COUNT mcnt]
{ {[MATCH LINE mlin]
[MATCH OFFSET moff]
[MATCH LENGTH mlen]}
| [RESULTS result_tab|result_wa] }
[SUBMATCHES s1 s2 ...].
Effect
Searches for character or byte strings or for
regular expressions in a character-type or byte-like data object dobj
or in an internal table itab
.
Additions
-
{FIRST OCCURRENCE}|{ALL OCCURRENCES OF}
Determines whether the search looks for only the first occurrence
or all occurrences. -
{[SUBSTRING] substring} | {REGEX regex}
Determines whether the search looks for a substringsubstring
or a regular expressionregex
. -
SECTION [OFFSET off] [LENGTH len] OF dobj
Search in a character- or byte stringdobj
with restriction of the search range to the section starting from the offset specified inoff
with the length specified inlen
. -
TABLE itab [FROM lin1 [OFFSET off1]] [TO lin2 [OFFSET off2]]
Search in an internal tableitab
with restriction of the search range to the section starting from the line specified inlin1
with the offset specified inoff1
until the line specified inlin2
with the offset specified inoff2
. -
IN {CHARACTER|BYTE} MODE
Determines byte or character string processing. -
{RESPECTING|IGNORING} CASE
Determines whether upper/lower case is taken into account insubstring
,regex
, anddobj
. -
MATCH COUNT mcnt
Returns the number of found locations inmcnt
. -
MATCH LINE mlin
When searching in internal tables, returns the line number of the last found location inmlin
. -
MATCH OFFSET moff
Returns the offset of the last found location inmoff
. -
MATCH LENGTH mlen
Returns the length of the last found substring inmlen
. -
RESULTS result_tab|result_wa
Returns the properties of all found locations or the last found location in an internal tableresult_tab
or a structureresult_wa
. -
SUBMATCHES s1 s2 ...
When searching for regular expressions, returns the contents of the subgroup registers of the last found location ins1
,s2
, ....