Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Character String and Byte String Processing →  Statements for Character String and Byte String Processing 

SHIFT

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


SHIFT dobj [ {[places]
[direction]} | deleting ] 
           [IN {CHARACTER|BYTE} MODE].

Addition

... IN {CHARACTER|BYTE} MODE

Effect

This statement shifts the content of a variable dobj. In places, you can specify the number of places to be shifted and in direction the direction of the shift. In deleting, you can specify which characters to delete from the data object by the shift. If you use no addition at all, then the content is shifted to the left by one place.

By default, free places created by the shift are filled with blanks or hexadecimal 0 for data objects of fixed length, depending on the kind of processing. Data objects of type string or xstring are shortened by the number of shifted places when shifted to the left, and lengthened by the number of shifted places when shifted to the right.

When the character string is processed, the closing blank characters are considered for data objects dobj of fixed length.


Note

To shift a string in an operand position, shift functions that cover part of the functionality of the SHIFT statement can be used.

Addition

... IN {CHARACTER|BYTE} MODE

Effect

The optional addition IN {CHARACTER|BYTE} MODE determines whether a character- or byte string processing is executed. Without the addition, a string processing is executed. Depending on the processing kind, dobj, substring and mask must be character-like or byte-like.

Continue

SHIFT - places

SHIFT - direction

SHIFT - deleting