SHIFT - deleting
Short Reference
ABAP Syntax ... { {LEFT DELETING LEADING} | {RIGHT
DELETING TRAILING} } mask ... .
What does it do? If you use these additions, the SHIFT statement
keeps moving the content of dobj by one position to the left or
the right until the content of the first or last position in dobj
is displayed in mask .
If the data object dobj is a string, it is shortened when it is
moved to the left but not extended when it is moved to the right. This
means the content of mask can also be moved to the right from a
string.
In character string processing, mask is a
character-type expression
position . The system takes account of the capitalization and closing
blanks entered in mask . If the content of the first or last
position in dobj is not displayed in mask , the content of
dobj remains unchanged. The system does not move the objects if
mask is an empty string.
Example ABAP Coding After it has been moved to the right, text
contains the value "_______I know you" and has a length of 15
characters.
DATA text TYPE string VALUE `I know you know`.
SHIFT text RIGHT DELETING TRAILING 'no kw'.
Example ABAP Coding The following example removes first the closing and then
the leading blanks from a string. For strings without leading blanks,
this sequence can be used to remove closing blanks.
DATA txt TYPE string VALUE `XXXXX `.
SHIFT txt RIGHT DELETING TRAILING ` `.
SHIFT txt LEFT DELETING LEADING ` `.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved