Skip to content

Overtake using Search & Replace

Instead of overtaking the whole method, overtake using Search and Replace can be used. This type of overtake finds a code section and replaces it with the code you want. If the code is changed in the underlying layer, you only need to handle your change, if the code you searched for has been removed. This is a type of surgical overtake, where you only overtake a small piece of code and not the whole method. Advanced overtake is suitable when you have few places in the same method that you want to change.

Code in a lower layer can be changed in different ways by adding $SEARCH, $REPLACE, $APPEND, $PREPEND and $END macro instructions. The code must be written in such a way that it can be parsed as-if the macro commands were comments. If that cannot be accomplished, then the commands $TEXTSEARCH, $TEXTREPLACE, $TEXTAPPEND, $TEXTPREPEND and $TEXTEND can be used instead.

Syntax of the replace statements, see $SEARCH.

Note: Replace statement is only allowed in the customization layer.

Search and Replace

In $SEARCH and $REPLACE you search for a given row(s) and replace the row(s) with the change you want to have in that part.

Example:

In generated, deployable code:

In case you only want to replace a part of a statement, the commands $TEXTSEARCH, $TEXTREPLACE and $TEXTEND can be used instead. Here you only include the code line(s) that you want to search and replace.

Example:

In generated, deployable code:

Search and Prepend

In $SEARCH and $PREPEND or in $TEXTSEARCH and $TEXTPREPEND, you search for a given row(s) and adds your change before the row(s) you searched for.

Example:

In generated, deployable code:

Search and Append

In $SEARCH and $APPEND or in $TEXTSEARCH and $TEXTAPPEND you search for a given row(s) and adds your change after the row(s) you searched for.

Example:

In generated, deployable code: