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

Similar Messages

  • 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.

  • How to convert date in one timezone to date in another timezone?

    Hi,
    I am building a web site which can be accessed by people across world in different timezones. I have a requirement to collect the data from the users in their respective timezones and convert it to the timezone in which the server is hosted before saving it. E.g. a user in "Kwajalein" timezone (GMT - 12) enters date as "10/23/2007 21:00", the time for the server which is hosted in indian timezone (GMT + 5.30) would be "10/24/2007 14:30". If I use the following program to convert the dates in these timezones it gives me wrong output.
    TimeZone tz = TimeZone.getTimeZone("Kwajalein");
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm");
    df.setTimeZone(tz);
    Date d = df.parse("10/23/2007 21:00");
    TimeZone tz1 = TimeZone.getTimeZone("Asia/Calcutta");
    df.setTimeZone(tz1);
    System.out.println("date in IST-->" + df.format(d));
    The output of this program is
    date in IST-->10/23/2007 14:30
    The formatter has changed the time component however it hasn't changed the date. It still appears as 23.
    Am I doing anything wrong here?
    Please pass your comments.
    Thanks,
    Shashi

    Please see the following link it may be helpfull to you
    1) http://forum.java.sun.com/thread.jspa?threadID=755558
    2) http://myhowto.org/java/36-all-about-locale-sensitive-time-processing-in-java/

  • How to convert Quantity in one unit to another

    My Requirement is to convert Quantity(kwmeng field)in one unit (UOM) say B01,D01 to KG's...Is there any function module
    to do this.
    any pointers on this would be very helpful
    Thanks

    Try function modules like [MD_CONVERT_MATERIAL_UNIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=md_convert_material_unit&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • Convert the all the quantity units into one Unit of measure that is 'CSE'.

    Hi all,
    I want to convert the all the quantity units into one Unit of measure that is 'CSE'.
    would anybody tell me what is the FM that converts all the quantity units into one Unit.
    Thanks in advance,
    Mythily

    Hi Mythily,
    You can check the following function module - -
    FCO_CONVERT_FROM_BASE_UNIT
    MD_CONVERT_MATERIAL_UNIT
    MS_CONVERT_UNIT_TO_TIME
    RV_CONDITION_CONVERT_UNITS
    VHUMISC_CONVERT_TO_ALTERN_UNIT
    VHUMISC_CONVERT_TO_BASEUNIT
    WALL_QUANTITY_CONVERT_UNIT
    WALL_QUANTITY_CONVERT_UNIT_RND
    WSTP_CONVERT_UNIT
    Regards
    Pinaki

  • 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)

  • 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 field to char field

    Hi folks ,
    i have a requirement where i need to convert quantity field value to char field value so as to send in idoc.
    plz help me .its urgent
    regards,
    chandra

    data: f1(17).
    f1 = qauntity_field.
    lenth of the field f1 is the same or gr8 than quan_field also add one more place for decimal .
    ex-
    ur quan_filed like 13 and 3 decimal place than ur char field must be
    13 + 3 + 1(for decimal) = 17

  • Converting quantity to char

    How to convert quantity to char without using FM's like C14W_CHAR_NUMBER_CONVERSION,
    C14W_NUMBER_CHAR_CONVERSION,
    CHAR_INT_CONVERSION as these FM's do not exist in my server?

    Hi...
    this is my program...try this code....
    Parameters:
      p_Number(9) type c.                  " Input string.
    data:
      w_number(9) type c,                  " Input number
      w_strlen(9) type c,                  " Strlen
      w_numc(9)   type n,                  " Digit string
      w_2bit(2)   type c.                  " first 2 positions
      w_number = p_number.
      w_numc = p_number.
      write: 'The given number in words:  '.
      do 5 times.
        case sy-index.
          when 1.
            w_2bit = w_numc+0(2).
          when 2.
            w_2bit = w_numc+2(2).
          when 3.
            w_2bit = w_numc+4(2).
          when 4.
            w_2bit+0(1) = 0.
            w_2bit1(1) = w_numc6(1).
          when 5.
            w_2bit = w_numc+7(2).
        endcase.                           " CASE SY-INDEX.
       if w_2bit+0(2) ne 0.
         if w_2bit le 19.
           case w_2bit.
            when '01'.
              write 'ONE'.
            when '02'.
               write 'TWO'.
            when '03'.
               write 'THREE'.
            when '04'.
               write 'FOUR'.
            when '05'.
               write 'FIVE'.
            when '06'.
               write 'SIX'.
            when '07'.
               write 'SEVEN'.
            when '08'.
               write 'EIGHT'.
            when '09'.
               write 'NINE'.
            when '10'.
               write 'TEN'.
            when '11'.
               write 'LEVEN'.
            when '12'.
               write 'TWELVE'.
            when '13'.
               write 'THIRTEEN'.
            when '14'.
               write 'FOURTEEN'.
            when '15'.
               write 'FIFTEEN'.
            when '16'.
               write 'SIXTEEN'.
            when '17'.
               write 'SEVENTEEN'.
            when '18'.
               write 'EIGHTEEN'.
            when '19'.
               write 'NINETEEN'.
           endcase.                        " CASE 2BITS POSITIONS 1,2.
        else.
          case w_2bit+0(1).
            when '2'.
               write 'TWENTY'.
            when '3'.
               write 'THIRTY'.
            when '4'.
               write 'FOURTY'.
            when '5'.
               write 'FIFTY'.
            when '6'.
               write 'SIXTY'.
            when '7'.
               write 'SEVENTY'.
            when '8'.
                write 'EIGHTY'.
            when '9'.
               write 'NINETY'.
          endcase.                         " CASE W_2BIT+0(1)
        if w_2bit+1(1) ne 0.
           case w_2bit+1(1).
             when '1'.
                write 'ONE'.
             when '2'.
                write 'TWO'.
             when '3'.
                write 'THREE'.
             when '4'.
                write 'FOUR'.
             when '5'.
                write 'FIVE'.
             when '6'.
                write 'SIX'.
             when '7'.
                write 'SEVEN'.
             when '8'.
                write 'EIGHT'.
             when '9'.
                write 'NINE'.
             when others.
                write ' '.
            endcase.                       " CASE W_2BIT+1(1)
         endif.                            " IF W_2BIT+1(1)
      endif.                               " IF 2BIT LE 19
      case sy-index.
          when 1.
            write 'CRORES'.
          when 2.
            write 'LAKHS'.
          when 3.
            write 'THOUSANDS'.
          when 4.
            write 'HUNDREDS'.
       endcase.                            " CASE SY-INDEX
    endif.                                " IF 2BIT NE 0

  • Statistical Setup Error - Error Converting Quantity

    Dear SDN Mates,
    We are getting this below error while doing the statistical setup for SD extraction in 11 application,
    Error converting quantity: unit M numerator 0 / denominator 0.
    Regards
    Arun S

    Hi guys,
    I have the same error with below message :
    Error determining rate: foreign curr.  local curr.KRW date 17.06.2011 (doc. 14024)
    I checked data in table VBAK with sale document 14024, some information of this data record related above error :
    + ERDAT (Date on Which Record Was Created) : 17.06.2011
    + WAERK (SD Document Currency) : KRW
    + STWAE (Statistics currency) : <BLANK>
    I tried to create 2 new records in Currency Exchange Rates (OB08), like this :
    But there're still error.
    Please give some ideas to solve it.
    Regards
    Dennis Vu,

  • Convert quantity field

    Hi All,
    How would I convert quantity field thats coming into XI as 6.000 to 6?? On the receiving side quantity is of integer data type.

    use the standard function 'formatNum' to achieve this...
    the parameter of 'formatNum' should be set to '#'....
    Thanks,
    Renjith
    Message was edited by:
            Renjith Andrews

  • Cheking the material for base unit  or convert it to base unit.

    Hi friends,
    I have a requirement asa follows.
    I Have an internal table ITAB1 in that i have some 200 records. In that ITAB1 i have
    MATNR and MEINS field and iam selecting those fields from MSEG table.
    Now my requirment is i have to check for base unit of that particular.
    example :
    now let us say iam getting in my ITAB1.
    MATNR      MEINS
    M-123          EA
    now  i have to check the base material for that material. if both the base unit and what i got i same then its ok.        or    if the both are not same then it should convert to the base unit.
    how can i do that.
    Regards,
    Priyanka.

    Hi Priyanka,
    To this FM u have to pass the material number, Input unit(itab1-meins), Output unit(Base unit-mara-meins), Quantity. In Importing parameter E_MENGE pass one variable. After FM call u will receive the converted value in this variable.
    Just check the where used list of the FM to see the sample code.
        CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
             EXPORTING
                  I_MATNR              = P_MATNR
                  I_IN_ME              = P_MEEHT "Input unit
                  I_OUT_ME             = P_AUSME "Base unit
                  I_MENGE              = P_MENGE "Input Quantity
             IMPORTING
                  E_MENGE              = I_AUMENGE "Quantity in base unit.
             EXCEPTIONS
                  ERROR_IN_APPLICATION = 1
                  OTHERS               = 2.
    Thanks,
    Vinod.

  • Unit Conversion Code to display the BW report in one unit

    Hi i want to display the units in US standards in initial view of report and allow users to convert in local units if they want.
    A. I find that data is comingfor "factory area" field in cube in various units such as FT(Feet), MT (Meters), ST, IN. as entered in ECC
    Please get me some help to write the ABAP code to convert the units in US standard units or tell me some functionality at report level to convert the units so that report display all data for "factory area" in one unit
    Thanks
    Regards
    Poonam Roy

    strange..
    1) is normal for checboxes and
    2) for radio buttons...
    A.

  • It's simple... I want the Illustrator pen tool to ALWAYS make corner annchor points and NEVER smooth.  Right now I have to convert every single one of them, or I have to do a work around every time I draw a line and make one of the handles disappear.  Is

    It's simple... I want the Illustrator pen tool to ALWAYS make corner annchor points and NEVER smooth.  Right now I have to convert every single one of them, or I have to do a work around every time I draw a line and make one of the handles disappear.  Is there some simple setting out there that will just "make it so?"@

    The video I am watching this guy is just dragging every line to make curves.  And every anchor point is a corner.  He is not switching back and forth between the pen and the anchor points tool, and he is not using the convert points tool.  He draws a curved line and starts another straight line only to curve it with a click and a drag.  It is super efficient, and I could save a world of time if I could figure out what he is doing.

  • Any chance the Mac mini and the Apple TV will be combined into one unit?

    Any chance the Mac mini and the Apple TV will be combined into one unit?

    No.
    The Apple TV is the guts of an iPad without the screen or battery running a different build of the OS. Ie, its very cheap to make and runs an ARM processor (like all iDevices)
    The Mac mini is 6x the price and is a full intel computer running the OS X.
    Now, it could be that the Apple TV gets more powerful and its OS more diverse and "computer like" (apps + iCloud for example), but for now they're still coming from totally different directions.
    They just happen to look alike

Maybe you are looking for