ADDCORRESPONDING
Basic form
ADDCORRESPONDING rec1 TO rec2.
Effect
Interprets rec1 and rec2 as field strings.
If, for example, rec1 and rec2 are tables, executes the
statement for their header lines.
Searches for all subfields which occur both in rec1 and
rec2 and then, for all relevant field pairs corresponding to the
subfields ni , generates statements of the form
ADD rec1ni TO rec2ni.
The other fields remain unchanged.
With complex structures, the complete names of the corresponding field
pairs must be textually identical.
Example

DATA: BEGIN OF VECTOR,
X TYPE I,
Y TYPE I,
LENGTH TYPE I,
END OF VECTOR,
BEGIN OF CIRCLE,
VOLUME TYPE P
Y TYPE P,
RADIUS TYPE I,
X TYPE I,
END OF CIRCLE.
...
ADDCORRESPONDING VECTOR TO CIRCLE.
The subfields X and Y occur in both the field strings
VECTOR and CIRCLE . Therefore, the
ADDCORRESPONDING statement is equivalent to both the following
statements:

ADD VECTORX TO CIRCLEX.
ADD VECTORY TO CIRCLEY.
Note
All fields with the same name are added, whether numeric
or not. The same conversions are performed as with
ADD and similar runtime errors to those
possible with ADD can also occur.
Related
ADD
MOVECORRESPONDING
SUBTRACTCORRESPONDING
MULTIPLYCORRESPONDING
DIVIDECORRESPONDING
Index
© SAP AG 1996