Zed FrameOpen workbench

ZED_STRING_NORMALIZE — ABAP Function Module

Trim text and collapse repeated whitespace to one space.

ZED_STRING_NORMALIZE

Trim text and collapse repeated whitespace to one space.

Parameters
NameDirectionTypeDescription
INPUT (required)EXPORTINGSTRINGSource text (maximum 32,768 characters)
OUTPUTIMPORTINGSTRINGNormalized text
DATA result TYPE string.
CALL FUNCTION 'ZED_STRING_NORMALIZE'
  EXPORTING input = '  ABAP   Playground  '
  IMPORTING output = result.
WRITE: / result.

Example output:

ABAP Playground

ZED_ denotes a local training helper. Whitespace is normalized without locale-specific text rules.

Exceptions: TEXT_TOO_LONG