Fonction SAP UNIT_CONVERSION_WITH_FACTOR - Translation with Specified Factors (Units)

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ADD_CONST 0 additive constant
DENOMINATOR 0 Denominator
INPUT 0 Input Value
NUMERATOR 0 Numerator

Paramètre Reférence Type Long. Description
OUTPUT 0 Output value

Exception Description
DIVISION_BY_ZERO Division by zero trapped
OVERFLOW Field overflow
TYPE_INVALID of output parameters is not a number


Functions
Conversion is carried out using the following formula:
Output value = ( numerator / denominator ) * input value + additiveconstant
Example
DATA: IN TYPE F,
OUT TYPE F,
NEN TYPE F,
ZAE TYPE F,
ADD TYPE F.
...
CALL FUNCTION 'UNIT_CONVERSION_WITH_FACTOR'
EXPORTING
ADD_CONST = ADD
INPUT = IN
DENOMINATOR = NEN
NUMERATOR = ZAE
IMPORTING
OUTPUT = OUT
EXCEPTIONS
DIVISION_BY_ZERO = 01
OVERFLOW = 02
TYPE_INVALID = 03.
Notes
  • For performance reasons, it is recommended that you always use floating
  • point numbers (type F) for calculations.
    • If you are working with packed fields or integers, you must make sure
    • that these fields are sufficiently large. In particular, you must takeinto consideration the fact that during conversion, the conversionfactors of different units are combined.
      INCLUDE 'FU_INF_BUF' OBJECT DOKU ID TX

622700Billing quantity rounded incorrectly
783695Determination of condition basis fails