Zed FrameOpen workbench

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.

Parameters
NameDirectionTypeDescription
INPUT (required)EXPORTINGSTRINGSource text (maximum 32,768 characters)
SUBSTRING (required)EXPORTINGSTRINGLiteral substring to find
REPLACEMENTEXPORTINGSTRINGReplacement text
OUTPUTIMPORTINGSTRINGUpdated 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 Workbench

ZED_ denotes a local training helper, not an SAP-delivered function module. Matching is literal and case-sensitive.

Exceptions: TEXT_TOO_LONG, SUBSTRING_EMPTY