SAP DATA PROCESS FIELDS ABEXA



Get Example source ABAP code based on a different SAP table
  



Offset/Length Specifications
This example demonstrates how substrings can be accessed using offset/length specifications.

ABAP_SOURCE_CODE
DEMO CL_DEMO_DATA_PROCESS_FIELDS

ABAP_DESCRIPTION
In the first part, the minutes of a time field are selected by specifying an offset. Then the minutes and seconds are set to their i nitial values by specifying an offset in the CLEAR statement.
In the second part, the five digit sequence 78901 from the field f2 is replaced with DEFGH from f1 by specifying offsets and lengths.
In the third part, assignments are used. First, the content of f1 is assigned to f2 without offset specifications. The same is then done with offsets and lengths for f1. The next three assignments overwrite the content of f2 with an offset of 2. Note that f2 is padded on the right with blanks, in accordance with the conversion rule for source type c.
In the fourth part, string templates are used. The first six places of the field number are written left-aligned, centered, and right-aligned to the last 12 places of the text field