Convert a quantity to KG

Hi ,
  how can i find that a quantity in a unit can be converted into KG.
My requirement is to create an inventory report and convert all quantity in KG ,there are some units that cannot be converted to KG how , can i determine it.
Regards
Arun

Hi~
You can use a function in 'SAP R/3 4.6C'.
Choose the function you like best!
  CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
       EXPORTING
            I_MATNR              = MATNRIAL
            I_IN_ME              = IN_MEINS
            I_OUT_ME             = OUT_MEINS
            I_MENGE              = IN_MENGE
       IMPORTING
            E_MENGE              = OUT_MENGE
       EXCEPTIONS
            ERROR_IN_APPLICATION = 1
            ERROR                = 2
            OTHERS               = 3.
  CALL FUNCTION 'CF_UT_UNIT_CONVERSION'
       EXPORTING
            matnr_imp              = MATERIAL
            unit_new_imp           = NEW_UNIT
            unit_old_imp           = OLD_UNIT
            value_old_imp          = MENGE
       IMPORTING
            value_new_exp          = MENGE
       EXCEPTIONS
            overflow               = 1.

Similar Messages

  • Function to convert PO quantity and cancelled quantity into Primary UOM

    Hello,
    I am looking for a function to convert PO quantity and cancelled quantity into its Primary UOM from the unit of measure the line order was placed.
    Thank you

    hi
    In case if you are already working in production remember that decimal places should not change. It will affect all previous data.
    For your problem best solution is make order unit as 1000. So that your problem will solve
    e.g. instead of 2.009 inr for 1 Unit use 2009 inr for 1000 unit.

  • How can i convert the quantity of one unit to other unit in BI 7?

    Hi ,
    I have developed an RFC function module in SAP BW (BI 7.0).
    For this function module I have to populate material  number and  Quantity required and UNIT.Every thing working good. If the user forgets to enter unit  or enters other unit  where Quantity in ODS is not mentioned in terms of that unit.WE have to Convert the Quantity requested into the Qunantity that exist in ODS or DATA BASE  based on the unit of measure .
    Please suggest me how can I convert the UNIT of measure of quantity?
    Thanks,
    Suresh.

    I have to do this with conversion table /BIO/PMAT_UNIT.
    IN THIS TABLE I DON'T KNOW HOW CAN I CONVERT?
    REGARDS,
    SURESH.

  • I want to convert the quantity(datau2019s type - QUAN) in words.

    Hi All,
    I want to convert the quantity(datau2019s type - QUAN) in words.
    I am using function module SPELL_AMOUNT. But I donu2019t use input parameter u201CCURRENCYu201D because I use the quantity instead of amount.
    But my problem is when i pass quantity value such as 195.500 without input parameter u201Ccurrencyu201D its just giving me output as ONE HUNDRED NINETY-FIVE THOUSAND FIVE HUNDRED in the field u201CSPELL-WORDu201D( the field u201CSPELL-DECWORDu201D is empty) instead of ONE HUNDRED NINETY-FIVE in the field u201CSPELL-WORDu201D and FIFTY in the field u201CSPELL-DECWORDu201D.
    DATA:
      v_fkimg1 TYPE vbrp-fkimg value '195.500',
      wa_spell TYPE spell.
      CALL FUNCTION 'SPELL_AMOUNT'
        EXPORTING
          amount    = v_fkimg1
          filler    = ' '
          language  = sy-langu
        IMPORTING
          in_words  = wa_spell
        EXCEPTIONS
          not_found = 1
          too_large = 2
          OTHERS    = 3.
      write: / wa_spell-word, wa_spell-decword.
    What should i do to solve this problem.
    Is there any other fn module or am i giving some wrong input?
    Plz suggest me.
    Regards,
    Sergey.

    Hi,
    Use FM 'HR_IN_CHG_INR_WRDS' as follows :
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
    amt_in_num = b
    IMPORTING
    amt_in_words = a
    EXCEPTIONS
    data_type_mismatch = 1.
    This will give you amount with decimal values as well but here there is another problem like if u give input as 19.50 it gives output as :
    NINETEEN RUPPESS FIFTY PAISE.
    May be after out put can do operation like find string and delete rupees and paise from the that.
    Hope this would be of some help!!!
    Regards,
    Lalit Kabra

  • Change (convert) delivery quantity

    Dear all,
    Does anyone know how I can change the delivery quantity ?
    What we ant to achieve is the following:
    - an order has been created with a quantity in sales units for example 10 BAG
    - at creation of delivery, we would like to convert the sales order quantity to the unit of issue (MARC-AUSME) if this one is different from the sales order sales unit (for example PAL iso BAG) ...
    I tried a few things yet to change the quantity (and unit) to the converted one, but it all didn't work ...
    Any idea how this can be done ?
    Thanks in advance !
    Greetz,
    Kurt.

      select single kwmeng vrkme into (lv_kwmeng,lv_vrkme)
                                 from vbap
                                 where vbeln = lips-vgbel
                                   and posnr = lips-vgpos.
      select single ausme into lv_ausme from marc
                                        where matnr = lips-matnr
                                          and werks = lips-werks.
      if sy-subrc eq 0 and lv_ausme is not initial.
        call function 'ZCF_UT_UNIT_CONVERSION'
          exporting
            matnr_imp      = lips-matnr
            unit_new_imp   = lv_ausme
            unit_old_imp   = lv_vrkme
            value_old_imp  = lv_kwmeng
          importing
            value_new_exp  = lv_lfimg
          exceptions
            invalid_input  = 1
            invalid_output = 2
            overflow       = 3
            others         = 4.
        if sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
        lips-lfimg = lv_lfimg.
        lips-vrkme = lv_ausme.
      endif.

  • FM to convert Delivery quantity value from Sales unit to Base Unit

    Hello,
    Is there any Function Module to Convert the Delivery quanitityt(LFIMG) value form Sale unit of Measere to Base Unit of  Measure?
    Regards
    Irfan

    HI
    Use this FM
    call function 'CF_UT_UNIT_CONVERSION'
          exporting
           matnr_imp           = wa_z3iexdoc-matnr
    *   MEINS_IMP           = ' '
           unit_new_imp        = 'EA'
           unit_old_imp        = wa_z3iexdoc-vrkme
           value_old_imp       = value_old_imp                  "1.000
         importing
           value_new_exp       = value_new_exp
         exceptions
           overflow            = 1
           others              = 2       .
    Here
    wa_z3iexdoc-matnr  is material No
    unit_new_imp          is new Price Unit
    wa_z3iexdoc-vrkme is Old Unit
    value_old_imp         is Old Value
    value_new_exp       is converted value

  • Convert PO quantity to MT

    Hi,
    In my Itab... I have ekpo data as
    menge     meins(Unit of measure)
    2.000         TO
    1.00           BAG
    3.00           TO
    I want to display in my internal table in MT (Metric ton) only...
    How can I do this?
    How can I convert Unit of measures from TO to MT          and
                                                             BAG to MT?

    Hi
    Use FM    MATERIAL_UNIT_CONVERSION
    Also see
    MC_UNIT_CONVERSION
    UNIT_CONVERSION_SIMPLE
    try using the function module MD_CONVERT_MATERIAL_UNIT
    See Sample code below...
    FORM f2121_convert_price USING p_lv_meins
    p_lv_kbetr
    p_lv_kmein
    p_lv_matnr
    p_lv_kschl.
    DATA: lv_imenge LIKE ekpo-menge,
    lv_emenge LIKE ekpo-menge.
    lv_imenge = p_lv_kbetr.
    CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
    EXPORTING
    i_matnr = p_lv_matnr
    i_in_me = p_lv_kmein
    i_out_me = p_lv_meins
    i_menge = lv_imenge
    IMPORTING
    e_menge = lv_emenge
    EXCEPTIONS
    error_in_application = 1
    error = 2
    OTHERS = 3.
    IF sy-subrc = 0.
    p_lv_kbetr = lv_emenge.
    ELSE.
    CONCATENATE text-009 p_lv_kschl INTO v_err_msg.
    ENDIF.
    ENDFORM.
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • How to convert a quantity from LB to MSF or HSM etc...

    Hi,
    whats the best FM to do this conversion..
    thanks

    1. My requirement is irrespective of material..
    2. unit_conversion_simple says cannot conver from mass to surface..
    anyway, i found a better way...calculated the weight per sales unit based on the VBAP entry and then used this as qty...
    thanks

  • Using conversion rule to convert quantity fields

    Hi!
    I am trying to find a way to use a conversion rule to convert a quantity specified in one unit of measure to the corresponding quantity specified in a different unit of measure. I was trying to use 'Copy sender field' along with a custom 'Special conversion rule'. However, the code to convert quantities requires both the quantity and material number to do the UoM conversion. 'Copy sender field' only allows the transfer of one sender field. Is there a way to transfer two sender field into a 'Special conversion rule'.  Any help much appreciated and rewarded. Thanks, Duncan

    Hi Duncan,
    Try FM UNIT_CONVERSION_SIMPLE.
    Regards,
    Atish

  • Convert quantity in one unit to quantity in another unit

    Hi all,
    I have to convert quantity in one unit to quantity in another unit.
    please suggest me a function module which converts.
    Ex :
    i have quantity : MVKE-SCMNG = 20
           Unit     : MVKE-SCHME = UUE
    now  convert the quantity
           quantity : ?
           Unit     : PCE
    i have used : UNIT_CONVERSION_SIMPLE, but it did not work.
    i think the conv is material specific.
    i can get values from MARM Table .. but i am looking for a function module which can convert.
    Thank you all in advance.

    Hi
    see this may be helpfull
    i had changed the sobid (45 char) to objid (8 numc)
    reward if usefull
    SELECT OTYPE
             OBJID
             RELAT
             BEGDA
             ENDDA
             SCLAS
             SOBID FROM HRP1001 INTO TABLE IT_HRP1001
                        WHERE OTYPE = 'D'
                            AND OBJID IN S_OBJID
                            AND BEGDA GE DATE-LOW
                            AND ENDDA LE DATE-HIGH
                            AND ( SCLAS = 'E' OR SCLAS = 'ET' ).
      IF SY-SUBRC NE 0.
        MESSAGE 'NO RECORD FOUND FOR THE GIVEN SELECTION CRITERIA ' TYPE 'E'.
      ENDIF.
      LOOP AT IT_HRP1001 INTO WA_HRP1001.
        WA_SOBID-OTYPE = WA_HRP1001-OTYPE.
        WA_SOBID-OBJID = WA_HRP1001-OBJID.
        WA_SOBID-RELAT = WA_HRP1001-RELAT.
        WA_SOBID-BEGDA = WA_HRP1001-BEGDA.
        WA_SOBID-ENDDA = WA_HRP1001-ENDDA.
        WA_SOBID-SCLAS = WA_HRP1001-SCLAS.
        WA_SOBID-SOBID = WA_HRP1001-SOBID.
        APPEND WA_SOBID TO IT_SOBID.
      ENDLOOP.
    regards
    naresh

  • Quantity conversion error in net price calculation in BAPI_PO_CREATE1

    I'm creating PO from BAPI_PO_CREATE1 .here i'm getting follwing error
    quantity conversion error in net price calculation.
    plz guide me to remove it.

    Are you using quantities directly entered by the user while calling the function to do the net price calculation? If that is the case, you should use FM CONVERSION_EXIT_ALPHA_INPUT to convert the quantity from the external format into the internal one!
    Another possibility is that some customizing is missing for converting quantities in different unit of measures (like the quantity in pieces is known, but the pricing calculation is being done on kilos.. but the convertion between these 2 unit of measures is missing).
    Good luck!

  • Quantity Copied in Purchase Order is not same as Purchase Requisition

    Dear All,
                                                                                    I have create a P.R with Quantity = 154.762,800 , but when this P.R was used to Create a Purchase Odrer but here the Quatity copied from P.R is 154.762 only , which is not as same as P.R , also during creation of P.O , I got a Warning Message as below  ( but i am able to save this P.O) :
    Order quantity violates rounding rules (See long text)
    Message no. ME386
    Diagnosis
    The rounding rule(s) marked with 'X' has/have been violated:
    [_] Rounding via static rounding profile
    [_] Rounding to order unit via dynamic rounding profile
    [_] Rounding to logistics unit via dynamic rounding profile
    [_] Minimum order quantity not reached
    [_] Maximum order quantity exceeded
    [_] Order quantity rounding value
    [_] Delivery unit
    [X] Fixed number of decimal places specified
    [X] Rest could remain because no variable order unit allowed
    System Response
    Rounding proposal: 154.762,000 ZAE (= 154.762,000 ST )
    When you enter the order quantity for the first time, the system converts the quantity and order unit automatically in accordance with the rounding proposal.
    If you change the order quantity, the system does not automatically adjust it.
    Example
    The following dynamic rounding profile exists:
    With an order quantity >= 150 pcs. the system rounds to two boxes
    With an order quantity < 150 pcs. the system rounds to 1 box.
    You order 160 pcs. The rounding proposal is as follows:
    2 Cases (= 160 pcs.)
    When you enter the order quantity for the first time, the rounding proposal 2 BOX is adopted.
    If you change the order quantity, the quantity entered remains unchanged. If you wish to adopt the rounding proposal, adjust the quantity accordingly.
    Can ne one help me how to check n where to Check / Maintain so that the Quatity should be copied in P.O as saame as it is in P.R.
    Best Rgds,
    sap11

    I think i have resolved the issue , here in trxn = cuni the decimal pl. rounding is to be maintain for that particular unit of measure.
    Steps
    1)Use Trxn -CUNI
    2)Click on Tab -Unit of Measurement
    3)Select the Unit which is to be used in Purchase Order
    4)After selecting go to Details icon on top
    5)In Conversion format enter the digits as per your need in Decimal Pl. rounding.
    6)In my case it is maintained as Zero, due to this reason the digits after decimal are not copied from P.R to P.O , But if this  Decimal Pl. rounding is mainained as 3 then system will allow me to copy the digits upto three digits after decimal.
    Rgds,
    sap11

  • Convert quantiy

    Hi friends,
    How to convert the quantity field value into words. For example let my quantity field value is 12.12 I need to convert this to twelve point twelve. .How to do this. Can I use the function module spell amount for quantity? I tried but I didn’t get proper result. Please help me.
    Thanks to all

    Hi,
    Try this Code,U will get tha Answer,
    DATA: QUANTITY TYPE SPELL-NUMBER VALUE '12.12',
          WORDS LIKE SPELL.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
        AMOUNT          = QUANTITY
        CURRENCY        = 'IND'
      FILLER          = ' '
      LANGUAGE        = SY-LANGU
    IMPORTING
        IN_WORDS        = WORDS
    EXCEPTIONS
      NOT_FOUND       = 1
      TOO_LARGE       = 2
      OTHERS          = 3
    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 : /'Rounded Value' , WORDS-WORD,'Decimal Value',WORDS-DECWORD.
    Regards,
    Padmam.

  • Function module needed - Convert price to one unit to another

    Hi All,
    I need FM to covert price to one unit to another.
    Any suggestion welcome.
    Regards,

    sorry the earlier one will convert the quantity this one will covert price
          CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
                EXPORTING
                  date             = sy-datum
                  foreign_amount   = w_material-stprs
                  foreign_currency = t001-waers
                  local_currency   = p_waers
                  type_of_rate     = 'M'
                IMPORTING
                  local_amount     = w_material-stprs
                EXCEPTIONS
                  no_rate_found    = 1
                  overflow         = 2
                  no_factors_found = 3
                  no_spread_found  = 4
                  OTHERS           = 5.

  • Quantity conversion from one unit to another

    Hello Experts,
    I need to convert quantity from one unit to another For eg: 1000kg to Grams.
    Is there any standard Function Module which can do so.
    Thanks.

    Hi,
    Try any of these.
    PRC_CNV_UNIT_CONV_ALT_TO_BASE - Convert Alternative to Base Product Unit
    PRC_CNV_UNIT_CONV_BASE_TO_ALT - Convert Base to Alternative Product Unit
    PRC_CNV_UNIT_CONV_ISO     -     Convert ISO Quantity Unit
    PRC_CNV_UNIT_CONV_SIMPLE  -     Convert Simple Unit (Without Product)

Maybe you are looking for