Conversion : from ml/l to gallon and kg to lbs

Question: Hi all,

I want to convert certain unit to another unit like
from ml/l to galon .
fields : volum

I tried to use the FM 'Material Unit Conversion' but it was not clear
what import and export parameters to use .

The units I intend to use are in table t006 as required by the FM .

Any inputs will be helpful,
Thanks,
Laxmi
_________________
Everything happens for a reason....

Answer:
...and it's quicker to ask SAPFans than to experiment




Try this:-

REPORT zconvert.


PARAMETERS : l_input TYPE i DEFAULT 456789.
PARAMETERS : l_uniti(3) DEFAULT 'MM'.
PARAMETERS : l_unito(3) DEFAULT 'M'.

DATA : l_output TYPE i.
DATA : l_add_const TYPE i.
DATA : l_decimals TYPE i.
DATA : l_denominator TYPE i.
DATA : l_numerator TYPE i.

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
     EXPORTING
          input                = l_input
          no_type_check        = 'X'
          round_sign           = ' '
          unit_in              = l_uniti
          unit_out             = l_unito
     IMPORTING
          add_const            = l_add_const
          decimals             = l_decimals
          denominator          = l_denominator
          numerator            = l_numerator
          output               = l_output
     EXCEPTIONS
          conversion_not_found = 1
          division_by_zero     = 2
          input_invalid        = 3
          output_invalid       = 4
          overflow             = 5
          type_invalid         = 6
          units_missing        = 7
          unit_in_not_found    = 8
          unit_out_not_found   = 9
          OTHERS               = 10.

IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE : / '   IN:', l_input,
        / 'CONST:', l_add_const,
        / '  DEC:', l_decimals,
        / 'DENOM:', l_denominator,
        / 'NUMER:', l_numerator,
        / '  OUT:', l_output.
_________________
The Doc
Magna Grand Docot of the Tuly Idiot Order

2007 Basic Rules
Copyright ?2007 - 2008 www.jt77.com