Someone once commented that the three great virtues of a programmer are
laziness, impatience, and hubris.
What this really means, though, is that
good programmers are always searching for ways to write reusable code
so that others can benefit from their labor.
ABAP, as a modern procedure language, has
many features that allow developers to write compact and reusable code.
One of the less-applied features is the use of field symbols. Field
symbols are used to dynamically assign references to a variable at runtime,
as opposed to the more conventional way in which variables are defined
at compile time.
In this article, I'll demonstrate the benefits
of field symbols, using a program I wrote for a real-world application.
For a more general understanding of field symbols, you can consult the
The Problem: Cumbersome Code for Populating Delimiter
Often, when writing an interface program, you need to extract SAP data
into a comma-delimited flat file. Normally, to do this, you would simply
add delimiters to a structure before transferring data to an operating
For example, I wrote a program to extract
material master data into a comma-delimited file. The first thing I did
was to define the structure of that comma-delimited file, shown in Listing