Paramètre | Reférence | Type | Long. | Valeur par déf. | Facultatif | Description |
---|---|---|---|---|---|---|
INPUT | 0 | Input Value | ||||
NO_TYPE_CHECK | 0 | 'X' | X | Conversion factor type check | ||
ROUND_SIGN | 0 | SPACE | X | Rounding flag (+ up, - down, X comm.) | ||
UNIT_IN | T006-MSEHI | C | 3 | SPACE | X | Unit of input value |
UNIT_OUT | T006-MSEHI | C | 3 | SPACE | X | Unit of output value |
Paramètre | Reférence | Type | Long. | Description |
---|---|---|---|---|
ADD_CONST | 0 | additive constant for conversion | ||
DECIMALS | 0 | Number of decimal places for rounding | ||
DENOMINATOR | 0 | Denominator for conversion | ||
NUMERATOR | 0 | Numerator for conversion | ||
OUTPUT | 0 | Output value |
Exception | Description |
---|---|
CONVERSION_NOT_FOUND | Conversion factor could not be determined |
DIVISION_BY_ZERO | Division by zero trapped |
INPUT_INVALID | Input value is not a number |
OUTPUT_INVALID | OUTPUT parameter is not a number |
OVERFLOW | Field overflow |
TYPE_INVALID | an output parameter is not a number |
UNITS_MISSING | no units specified |
UNIT_IN_NOT_FOUND | UNIT_IN is not maintained |
UNIT_OUT_NOT_FOUND | UNIT_OUT is not maintained |
Functionality This FM converts values from one measurement unit to another and roundsthe result to the number of decimal places maintained in themeasurement unit table, if necessary. The rounding is up ('+'), down('-'), commercial ('X') or no rounding (SPACE), depending on theparameter ROUND_SIGN. It can also be used for rounding according to the measurement unittable only. In this case UNIT_IN = UNIT_OUT. Conversion requires that both units are maintained in the measurementunit table and have the same dimension and are notboth without dimension. Rounding is also possible for dimensionless units. Example DATA: VALUE_IN TYPE F, VALUE_OUT TYPE F, UNIT_IN LIKE T006-MSEHI, UNIT_OUT LIKE T006-MSEHI. ... CALL FUNCTION 'UNIT_CONVERSION_SIMPLE' EXPORTING INPUT = VALUE_IN ROUND_SIGN = 'X' UNIT_IN = UNIT_IN UNIT_OUT = UNIT_OUT IMPORTING OUTPUT = VALUE_OUT EXCEPTIONS CONVERSION_NOT_FOUND = 01 DIVISION_BY_ZERO = 02 INPUT_INVALID = 03 OVERFLOW = 04 OUTPUT_INVALID = 05 UNITS_MISSING = 06 UNIT_IN_NOT_FOUND = 07 UNIT_OUT_NOT_FOUND = 08. Notes
INCLUDE 'FU_INF_BUF' OBJECT DOKU ID TX If this parameter is not specified when the function module is calledin the program, the exception OUTPUT_INVALID is raised. The output parameters NUMERATOR, DENOMINATOR andADD_CONST are type-checked and checked for overflow. No check. By default no check is made. If one of the three output parameters NUMERATOR, DENOMINATOR andADD_CONST is not specified at the call, NO_TYPE_CHECK ='X' must be specified (default). |