SAP FIXED POINT ARITH EXTERNAL
Get Example source ABAP code based on a different SAP table
Fixed Point Arithmetic in External Procedure Calls
A procedure called externally is executed in accordance with the property
Latest notes:
The justification for the behavior described here is that parameter passing should be independent of pass by reference and pass by value. To avoid the corresponding problems, it is strongly recommended that fixed point arithmetic is not switched off in any program. In this context, this applies particularly to class pools and function pools.
ABAP_HINT_END
Example ABAP Coding
The following example is a global class:
PUBLIC SECTION.
CLASS-METHODS meth RETURNING value(p) TYPE string.
ENDCLASS.
CLASS cl_test IMPLEMENTATION.
METHOD meth.
p = '1000'.
ENDMETHOD.
ENDCLASS.>
A calling program section could be as follows:
pack = cl_test=>meth( ).>
Depending on the properties, the result is as follows, where the properties of the calling program are in the top line and the properties of the called program are in the left column:
The formal parameter is assigned to the bound actual parameter, including the associated conversion while respecting the decimal sep arators, only if fixed point arithmetic is switched on in the called procedure. If fixed point arithmetic is switched off in the called procedure, the decimal separator of the actual parameter is ignored.
The call could also, however, appear as follows:
pack = + cl_test=>meth( ).>
In this case, the result looks like this:
In this case, the call takes place in an
The behavior in the second case usually corresponds to the expectations of a caller. This can, of course, also be achieved by introducing a helper variable of the type of the formal parameter that is first used as an actual parameter in the calling program and then assigned to the target field.
ABAP_EXAMPLE_END