DIVIDE-CORRESPONDING (ABAP Keyword) introduction & syntax details
DIVIDE-CORRESPONDING rec1 BY rec2.
Interprets rec1 and
rec2 as field strings, i.e. if rec1 and rec2 are tables with header lines, the
statement is executed for their header lines.
Searches for all sub-fields
that occur both in rec1 and rec2 and then generates, for all field pairs
corresponding to the sub-fields ni , statements similar in the following
DIVIDE rec1-ni BY rec2-ni.
The other fields remain
With more complex structures, the complete names of the field
pairs must be identical.
DATA: BEGIN OF
VALUE_IN(20) VALUE ‘German marks’.
USA TYPE I VALUE 100,
TYPE I VALUE 200,
AUT TYPE I VALUE 300,
END OF MONEY,
VALUE ‘DM to national currency’.
USA TYPE F
FRG TYPE F VALUE ‘1.0’,
AUT TYPE F VALUE ‘0.14286’,
DIVIDE-CORRESPONDING MONEY BY CHANGE.
MONEY-VALUE_IN = ‘National
The above DIVIDE-CORRESPONDING statement is equivalent to
the following three statements:
DIVIDE MONEY-USA BY
DIVIDE MONEY-FRG BY CHANGE-FRG.
DIVIDE MONEY-AUT BY
All fields of the same name are divided,
whether numeric or not. The conversions performed are the same as those for
DIVIDE and similar runtime errors can occur.
Related DIVIDE ,
MOVE-CORRESPONDING , ADD-CORRESPONDING , SUBTRACT-CORRESPONDING ,