SAP FIXED POINT ARITH EXTERNAL
Get Example source ABAP code based on a different SAP table
ARTICLE
Fixed point arithmetic during external procedure call
A procedure that is called externally is executed according to the attribute
Example
Let us take 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 look as follows:
pack = cl_test=>meth( ).
Depending on the attributes, the result then looks as follows, whereby the attributes of the calling program are listed in the top row and the attributes of the called program are listed in the left-hand column:
Only when the fixed point arithmetic is switched on in the called procedure does the system assign the formal parameter to the linked actual parameter, including the associated conversion and taking into account its decimal separator. if the fixed point arithmetic is switched off in the called procedure, the system does not take into account the decimal separator of the actual parameter.
However, if the call looks as follows:
pack = + cl_test=>meth( ).
The result looks like this:
In this case, the call takes place in an
The behavior in the second case generally corresponds to the expectations of a calling program. Of course, we can also acheive this by introducing an auxiliary variable of the same type as the formal parameter that we use in the calling program first as an actual parameter and then assign to the target field.
Note
The justification for the behavior shown here is that the passing of parameters is to be independent of pass by reference and pass by value. To bypass the associated problems, we strongly recommend not switching off the fixed point arithmetic in any program. In this context, this applies particularly to