ZED_STRING_REPLACE — ABAP Function Module
Replace all occurrences of a literal substring in bounded text.
ZED_STRING_REPLACE
Replace all occurrences of a literal substring in bounded text.
| Name | Direction | Type | Description |
|---|---|---|---|
| INPUT (required) | EXPORTING | STRING | Source text (maximum 32,768 characters) |
| SUBSTRING (required) | EXPORTING | STRING | Literal substring to find |
| REPLACEMENT | EXPORTING | STRING | Replacement text |
| OUTPUT | IMPORTING | STRING | Updated text |
DATA result TYPE string.
CALL FUNCTION 'ZED_STRING_REPLACE'
EXPORTING input = 'ABAP Playground'
substring = 'Playground'
replacement = 'Workbench'
IMPORTING output = result.
WRITE: / result.Example output:
ABAP WorkbenchZED_ denotes a local training helper, not an SAP-delivered function module. Matching is literal and case-sensitive.
Exceptions: TEXT_TOO_LONG, SUBSTRING_EMPTY