ARTIClE
Substrings
This example demonstrates how substrings can be accessed.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
In the first part, the minutes of a time field are selected by
specifying an offset. Then the minutes and seconds are set to their i
nitial values by specifying an offset in the CLEAR statement.
In the second part, the five character sequence 78901 from the field
f2 is replaced with DEFGH from f1 by specifying
offsets and lengths.
In the third part, assignments are used. First, the content of f1
is assigned to f2 without offsets. This is repeated with offsets
and lengths for f1 . The next three assignments overwrite the
content of f2 with an offset of 2. Note that f2 is padded
on the right with blanks, in accordance with the conversion rules for
source type c .
In part four, the WRITE TO statement is used. The first six
positions of the field number are written left-justified,
centered, and right-justified into the last 12 positions of the
string field.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved