Ansicht
Dokumentation
UNIT_CONVERSION_SIMPLE - Measurement unit conversion by table T006, with rounding
RFUMSV00 - Advance Return for Tax on Sales/Purchases CPI1466 during BackupThis documentation is copyright by SAP AG.
This function module converts values from one measurement unit to another and rounds the result to the number of decimal places entered in the measurement unit table, if necessary. The rounding is up ('+'), down ('-'), commercial ('X'), or no rounding (SPACE), depending on the parameter ROUND_SIGN.
It can also be used for rounding in accordance with the measurement unit table only. In this case UNIT_IN = UNIT_OUT must be specified.
Conversion requires that both units are entered in the measurement unit table and have the same dimension and are not both 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.
- If the parameter OUTPUT is not specified in the function module call, the exception OUTPUT_INVALID is raised. If only the conversion factors need to be read, the function module CONVERSION_FACTOR_GET can be used.
- All function modules in this group are selectively buffered by default. This internal table buffering can be disactivated with the function module BUFFER_CONTROL or switched to 'complete buffering'. used.
- All function modules in this group are selectively buffered by default. This internal table buffering can be disactivated with the function module BUFFER_CONTROL or switched to 'complete buffering'.
Parameters
ADD_CONSTDECIMALS
DENOMINATOR
INPUT
NO_TYPE_CHECK
NUMERATOR
OUTPUT
ROUND_SIGN
UNIT_IN
UNIT_OUT
Exceptions
CONVERSION_NOT_FOUNDDIVISION_BY_ZERO
INPUT_INVALID
OUTPUT_INVALID
OVERFLOW
TYPE_INVALID
UNITS_MISSING
UNIT_IN_NOT_FOUND
UNIT_OUT_NOT_FOUND
Function Group
SCV0rdisp/max_wprun_time - Maximum work process run time CL_GUI_FRONTEND_SERVICES - Frontend Services
This documentation is copyright by SAP AG.
Length: 5054 Date: 20240605 Time: 173322 sap01-206 ( 51 ms )