Show TOC

Searching Through and Replacing Table RowsLocate this document in the navigation structure

Using the statement:

REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF] pattern   IN TABLE itab ...WITH new [IN {BYTE|CHARACTER} MODE] ...

the internal table itab is searched through, row by row, for the byte or character strings determined by pattern. The found location(s) is (are) replaced by the content of the new data object - depending on whether the first or all occurrences of the search pattern are searched for (optional addition {FIRST OCCURRENCE}|{ALL OCCURRENCES} OF). For itab, a standard table has to be specified. The row type in the table must be either byte or character, depending on which of the additions BYTE and CHARACTER MODE has been selected. Byte or character strings that cover several table rows are not found.

For further details and additions to the statement, refer to the keyword documentation.