ABAP Keyword Documentation → ABAP - Reference → Obsolete Language Elements → Obsolete Processing of Internal Data → Obsolete Calculation Statements
DIVIDE-CORRESPONDING
Other versions:
7.31 | 7.40 | 7.54
Obsolete Syntax
DIVIDE-CORRESPONDING struc1 BY struc2.
Effect
This statement is not allowed in classes and divides structures by component. Structures must be specified
for struc1
and struc2
. For all components of the
same name in struc1
and struc2
, the components
of struc1
are divided by the components in struc2
in pairs, and the result is assigned to the relevant component in struc1
.
The names are compared, as in the statement
MOVE-CORRESPONDING. For each component pair with the same name comp
, the statement
DIVIDE struc1-comp BY struc2-comp.
is executed, and the appropriate conversions are performed, if necessary.
In complex structures, the names of the field pairs in question have to be completely identical at all hierarchical levels.
Note
This statement is error-prone because, particularly in complex structures, it is not easy to check that components of the same name have the data type and content necessary for a numeric operation.
Exceptions
Catchable Exceptions
CX_SY_ARITHMETIC_OVERFLOW
-
Cause: Overflow in arithmetic operation (type
p
)
Runtime Error:BCD_OVERFLOW
-
Cause: Integer overflow in division
Runtime Error:COMPUTE_INT_DIV_OVERFLOW
CX_SY_CONVERSION_OVERFLOW
-
Cause: Overflow in arithmetic operation (type
p
, with specified length)
Runtime Error:BCD_FIELD_OVERFLOW
CX_SY_ZERODIVIDE
-
Cause: Division by 0 (type
p
)
Runtime Error:BCD_ZERODIVIDE
-
Cause: Division by 0 (type
f
)
Runtime Error:COMPUTE_FLOAT_ZERODIVIDE
-
Cause: Division by 0 (type
i
)
Runtime Error:COMPUTE_INT_ZERODIVIDE
Non-Catchable Exceptions
-
Cause:
p
field does not contain the correct BCD format
Runtime Error:BCD_BADDATA