SHIFT - direction
... [LEFT|RIGHT] [CIRCULAR] ...
The shift direction is defined using
If neither of the additions is specified,
LEFT is used implicitly. If the
dobj is a string and the addition
is not specified, it is truncated when shifted to the left by the places shifted and lengthened accordingly when shifted to the right.
The content of text field
text is moved one place to the right, by which the digit "9" is lost. The data type
string would lengthen the string by one space.
DATA(text) = '0123456789'. SHIFT text RIGHT. cl_demo_output=>display( text ).
Using the addition
CIRCULAR, the content shifted from the data object to
the left or to the right, is inserted again in the places that become available on the opposite side.
If the addition
CIRCULAR is specified, data objects of the type
xstring are not shortened or lengthened; instead, they are handled as data objects of fixed length.
This example is a variant of the second example under
places. Using the addition
CIRCULAR, the result becomes "you know I know".
DATA text TYPE string VALUE `I know you know `. SHIFT text UP TO 'you' LEFT CIRCULAR.