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 →  Common Parameters of Character String Functions 

occ - Occurrence

Other versions: 7.31 | 7.40 | 7.54

Syntax


... ( ... occ = occ ...  ) ...

Effect

In string functions in which searches are carried out, the occ parameter specifies the number of matches that are to be searched for in the search range. occ is a numerical expression position.

If occ is positive, occurrences are counted from the left; if occ is negative, occurrences are counted from the right. The values 1 and 2 therefore mean the first and second occurrence, for example. Similarly, the values -1 and -2 mean the last and second last occurrence.

The default value for occ is 1. If 0 is specified as the value in a function other than the replace function, an exception of class CX_SY_STRG_PAR_VAL is triggered.


Note

The sign for occ also has an impact on the default values for off and len.