Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!



TXBHW - Original Tax Base Amount in Local Currency   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

SHIFT, places

Short Reference

... ${BY num PLACES$} $| ${UP TO substring$} ...


1. ... BY num PLACES ...

2. ... UP TO substring ...

Variant 1

... BY num PLACES ...


The content of dobj is shifted to the left or right by the positions specified in num, depending on the specification in direction. num is a numeric expression position of operand type i. If the content of num is less than or equal to 0, the content of the data object dobj remains unchanged.

The statement FIND determines the offset of the word "you" in text and shifts its content by this length to the left or right. After the shift, text contains "you know" and is eight characters long.

Variant 2

... UP TO substring ...


In the data object dobj, the first substring is searched for whose content matches that of substring. The search is case-sensitive. Depending on the specification in direction, the content of the data object dobj is shifted to the left or right until the byte string or character string contained in substring is left-aligned or right-aligned at the position that is at the beginning or end of the data object dobj before the shift.

substring expects a character-like or byte-like data object. If substring is an empty string, the place in front of the first character or byte is found. There is no shift to the left but a shift by the entire length of dobj to the right.

In character string processing, substring is a character-like expression position; in data objects, substring with a fixed length respects the trailing blanks.

System Fields

sy-subrc Meaning
0 The substring in substring was found in the data object dobj and its content was moved accordingly.
4 The substring in substring was not found in the data object dobj and its content remain unchanged.


For data objects of fixed length, the substring searched for after the shift is either left-aligned at the beginning or right-aligned at the end of the data object, depending on the direction. In the case of strings, the shift makes the data object longer on the right, which means that the substring is not at the right margin after the shift.

This example has the same result as the previous example. However, here the search for "you" is not performed in the statement SHIFT itself.

BAL Application Log Documentation   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 3994 Date: 20230207 Time: 102324     sap01-206 ( 73 ms )