SAP SHIFT DELETING ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• LEFT DELETING LEADING SHIFT
• RIGHT DELETING TRAILING SHIFT

SHIFT, deleting
Short Reference

ABAP_SYNTAX
... ${ ${LEFT DELETING LEADING$}
$| ${RIGHT DELETING TRAILING$} $} mask ...

What does it do?
If these additions are used, the statement SHIFT shifts the content of dobj by one place to the left or the right as long as the content of the first or last place of dobj is contained in mask.
If the data object dobj is a string, it is truncated when it is shifted to the left but not lengthened when it is shifted to the right. This means the content of mask can also be moved out of a string to the right.
In character string processing, mask is a character-like expression position. It is case-sensitive and any trailing blanks in mask are respected. If the content of the first or last place in dobj is not contained in mask, the content of text remains unchanged. In particular, nothing is shifted if mask is an empty string.

ABAP_EXAMPLE_VX5
After the shift to the right, text contains the value _____I know you and keeps its length of 15 characters.
ABEXA 00667
ABAP_EXAMPLE_END

ABAP_EXAMPLE_VX5
The following example removes first the trailing blank and then the leading blanks from a string. For strings without leading blanks, this sequence of statements can be used to remove trailing blanks.
ABEXA 00668
ABAP_EXAMPLE_END

Return to menu