## 4.2.15.12.4.1  Simple Conversion Between Two Units
Use method UNIT\_CONVERSION\_SIMPLE to convert values from one measurement unit to another and round the result to the number of decimal places maintained in the measurement unit table T006 , if necessary. Depending on the parameter ROUND\_SIGN , the rounding is up ( '+' ), down ( '-' ), commercial ( 'X' '), or no rounding (SPACE).
<!-- image -->
##  Note
Make sure that both units are maintained in the measurement unit table and are not dimensionless, but have both the same dimension.
## Import Parameters
Parameter Name
INPUT
Value Help
Input value
| Parameter Name   | Value Help                                                     |
|------------------|----------------------------------------------------------------|
| NO_TYPE_CHECK    | Conversion factor type check 'X' : No check Space : Type check |
| ROUND_SIGN       | Rounding flag '+' : Up '-' : Down 'X' : Commercial             |
| UNIT_IN          | Unit of input value                                            |
## Export Parameters
| Parameter Name   | Value Help                            |
|------------------|---------------------------------------|
| ADD_CONST        | Additive constant for conversion      |
| DECIMALS         | Number of decimal places for rounding |
| DENOMINATOR      | Denominator for conversion            |
| NUMERATOR        | Numerator for conversion              |
| OUTPUT           | Output value                          |
## Exceptions
| Exception Name       | Value Help                                |
|----------------------|-------------------------------------------|
| CONVERSION_NOT_FOUND | Conversion factor could not be determined |
| DIVISION_BY_ZERO     | Division by zero caught                   |
| INPUT_INVALID        | Input value is not a number               |
| OUTPUT_INVALID       | Output parameter is not a number          |
| OVERFLOW             | Field overflow                            |
| TYPE_INVALID         | Output parameter is not a number          |
## Value Help
| UNITS_MISSING      | No units specified         |
|--------------------|----------------------------|
| UNIT_IN_NOT_FOUND  | UNIT_IN is not maintained  |
| UNIT_OUT_NOT_FOUND | UNIT_OUT is not maintained |
##  Sample Code
```
CLASS zcl_uom_conversion DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. INTERFACES if_oo_adt_classrun. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_uom_conversion IMPLEMENTATION. METHOD if_oo_adt_classrun~main. DATA: lv_input  TYPE p DECIMALS 8 VALUE '1.98678923', lv_result TYPE p DECIMALS 8. DATA(lo_unit) = cl_uom_conversion=>create( ). lo_unit->unit_conversion_simple( EXPORTING  input                = lv_input round_sign           = 'X' unit_in              = 'KG' unit_out             = 'G' IMPORTING  output               = lv_result EXCEPTIONS conversion_not_found = 01 division_by_zero     = 02 input_invalid        = 03 output_invalid       = 04 overflow             = 05 units_missing        = 06 unit_in_not_found    = 07 unit_out_not_found   = 08 ). IF sy-subrc = 0. out->write( lv_result ). ENDIF. ENDMETHOD. ENDCLASS.
```
## Related Information
For information about the built-in function UNIT\_CONVERSION on CDS view level, see Handling of Amounts and Quantities in the ABAP Data Models Guide, and CDS DDL - CDS View Entity, Unit and Currency Conversion Functions in the ABAP Keyword Documentation.