Ansicht
Dokumentation

ABAPSHIFT_PLACES - SHIFT PLACES

ABAPSHIFT_PLACES - SHIFT PLACES

CPI1466 during Backup   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

SHIFT, places

Short Reference



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

Variants:

1. ... BY num PLACES ...

2. ... UP TO substring ...

Variant 1

... BY num PLACES ...


Effect

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 ...


Effect

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.

Note

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.






Addresses (Business Address Services)   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 3994 Date: 20240419 Time: 201301     sap01-206 ( 47 ms )