Conversion of unit of measure function module.

Hi All,
Can you let me know the function module that convert the unit of measure from EACH(EA)to cases(CS). I have the material that unit of measure is in EACH(EA). And i have to dispaly in cases(CS).
Regards,
Rakesh Singh

Hi Rakesh,
Try this Function Module:
MD_CONVERT_MATERIAL_UNIT
Im sending you a sample code also.
*& Form  f2121_convert_price
Convert price to Base UoM
     -->P_LV_MEINS  Conversion UoM
     -->P_LV_KBETR  Converted Rate
     -->P_LV_KMEIN  Condition unit
     -->P_LV_MATNR  Material Number
     -->P_LV_KSCHL  Condition Type
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.                    " f2121_convert_price
Hope this helps you.
Regards,
Anjali.

Similar Messages

  • How to Measure Function Module Performance?

    Please can you tell me how I can measure the performance and trace the actions of a Function Module in R/3?
    The function module in R/3 is run when a user calls a WebDynpro action from a WebDynpro screen within the SAP Portal.
    I have tried running a trace on a user (ST05) but that only shows table actions (e.g. reads/fetch etc.). Also it does not appear in ST04 or ST03N. I would like to know how long the program actually takes to run.
    Thanks.
    Paul

    Hi,
    if I want to measure the runtime required to run some Abap, I use SE30. However i used it only for normal Dynpro application, not WebDynpro.
    The detail level of the created trace can be configured. The aggregation level should be set to "Full" or "By call" at the beginning. Disabling aggregation leads to huge trace files.
    You can select which statements should be traced. If you disable an option it's runtime is not lost but add to the traced action in the next level. If for example "Open SQL" is disabled, the time used by it is added into the net time of the method, function module of subroutine. Otherwise if "Open SQL" is enabled the net time of a function module does not include SQL time. SQL time is then listed separately.
    Greetings

  • Conversion of Unit of Measure in ALV Grid

    Hi all,
    I am using function 'REUSE_ALV_GRID_DISPLAY' to display some records in ALV grid. The record displays material, the quantity of the material consumed and the unit of measure (UoM) of the quantity. I am fetching the data from the table AUFM and the field I am using for UoM is ERFME.
    The problem is that when the UoM is displayed in the ALV, it is displayed as KAR but when i print the report or check the print preview, the UoM is displayed as CAR. I want to display CAR also in the ALV.
    I have tried using the function 'CONVERSION_EXIT_CUNIT_OUTPUT' which converts the KAR to CAR in the ALV, but when I print it or check the print preivew ,  it shows asterisks (*) in the UoM field.
    Can anyone tell me why this is happening and how I can solve this problem? Any help will be greatly appreciated.
    Regards,
    Hamza

    Hi Ozkar,
    I tried the function 'CONVERSION_EXIT_CUNIT_OUTPUT', it worked fine when displaying the UoM in the ALV, meaning it displayed CAR instead of KAR, but when I printed the list or chicked the print preview, it displayed stars (***) in the UoM field.
    Anyway, I tried something else and now it is working fine. I am writing below what I did so that if anyone else has this problem, they can also do what I did.
    As I said before, the UoM field was showing KAR instead of CAR in the ALV. So after passing the data to an internal table which would be used to display the data in the ALV, I called the function 'CONVERSION_EXIT_CUNIT_OUTPUT' and converted KAR to CAR. this displayed CAR in the ALV.
    Now, to also get CAR in the print out and print preview,I declared variables gt_event_exit and lt_event_exit.
    DATA: gt_event_exit TYPE  STANDARD TABLE OF slis_event_exit,
               lt_event_exit TYPE slis_event_exit.
    The variable will 'lt_event_exit' will contain the function codes of the Print(&RNT) and Print Preview (&RNT_PREV) buttons on the ALV. In the form where I am calling the function 'REUSE_ALV_GRID_DISPLAY', I pass the function codes to lt_event_exit and append it to the internal table gt_event_exit.
      lt_event_exit-ucomm = '&RNT'.
      lt_event_exit-before = 'X'.
      APPEND lt_event_exit TO gt_event_exit.
      lt_event_exit-ucomm = '&RNT_PREV'.
      lt_event_exit-before = 'X'.
      APPEND lt_event_exit TO gt_event_exit.
    Next I pass this table to the parameter 'IT_EVENT_EXIT' of 'REUSE_ALV_GRID_DISPLAY'. I also create a form USER_COMMAND and pass this form to the parameter 'I_CALLBACK_USER_COMMAND' of 'REUSE_ALV_GRID_DISPLAY' as shown below.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND '
                 IT_EVENT_EXIT                          = gt_event_exit
    What the above does is that, when a user clicks on the print or print preview button, the system instead of printing the list, it passes the control to the form USER_COMMAND. After the form is processed, it prints the list.
    In the form, I placed a loop on the internal table containing the data to be shown and simply converted the CAR back to KAR. The code is given below.
      FORM user_command USING  r_ucomm LIKE sy-ucomm
                              rs_selfield TYPE slis_selfield .
        CASE r_ucomm .
          WHEN '&RNT' OR '&RNT_PREV'.
            LOOP AT i_final .
              CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
                 EXPORTING
                   input = i_final-erfme
                   language = sy-langu
                 IMPORTING
                   output = i_final-erfme
                 EXCEPTIONS
                   unit_not_found = .
              MODIFY i_final.
            ENDLOOP.
       WHEN .
       WHEN OTHERS.
        ENDCASE.
    I hope this is helpful to anyone who has the same problem as I did. Now what I cant figure out is why the system automatically converts KAR to CAR when displaying print preview or when printing the list.
    Well, thanks anyway for the suggestion Ozkar.
    Regards,
    Hamza

  • How to deassign a employee from a Org. unit by using function module?

    Hi,
    I want to deassign an employee from an orgnization unit in Org. model. Though I know I can do it manually in Org. Model. But since the number is big, I want to do it by using report. So do you which function module I can use to do it?
    Many thanks and Best regards,
    Long

    Hi,
    I feel following 2 Fms will be of use to you.
    1. BUB_BUPA_RELATION_MODIFY
    2. BUB_BUPA_RELATIONS_MODIFY
    I hope this helps.
    Regards,
    Venkat

  • Regarding Base Unit conversion to Unit of measure

    Hi all ,
    I have a  Custom report which post the goods Issue .
    The program uses tables mard and mska. In mard table fields used are mard-matnr,  mard-labst,mard-Lagerort,mska-sobkz,mska-vbeln,  mska-posnr,e mard-werks.
    the program call mb1a for updating the data using Bdc .
    <b></b>the problem is that the quantity of the stock is
    shown only in the base unit of measure .. but some material have Alternative Unit of measure  ... Its not taking Alternative Unit of measure ...
    Any help is highly appreciated ..
    Regards,
    Amarnath Reddy.

    Hi all ,
    the program aim is to transfer the stock from the storage location with reference to order number from  CO (cobl-aufnr).
    In mard when i am able to c the unit of issue for the selected material number.
    My question is in the report program sap is not looking for the unit of issue . It is only taking basic unit of issue ... Is there any way that program looks for the Unit of issue .

  • Conversion of unit of measure

    Dear Guru,
    I am making Sales Order, when I give freight in KG, it does not convert in gram or Ton. from where it will be done.
    Regards,
    Manoj Kumar

    Hi,
    In MMR sales view u maintain the sale unit, it will ask for the relation, give the relation & save it.
    Now u do sale order it will pick.
    Pandari

  • How can i know a perticular  quantity unit of measure is convertable or not

    hi ,
    depending on the delivery quantity unit of measure (likp-vrkme).
    i have to convert into M2,LM,VM.
    i require 2 things.
    1. for exanmple let the LIKP-VRKME = 'XX'.
       how can i come to know wether XX is convertable to M2,LM,VM or all of the    three.
    2. i need a standard unit of measure  function module .
    Thanks & Regads
    Suresh kumar

    hi ,
    very good question...
    the answer is the UOM must have same dimension...
      ex: If you want to convert 1litre of petrol to some other UOM, the UOM which you are going to convert must have the same dimension .. in this case petrol is a liquid ... litre has dimension liquid... litre can be converted to Gallons,  kilo litres, barrles.. etc
    You can find the relationship in table T006 and filed DIMID... check whether all the UOM has same DIMID .. then go ahead with the conversion...

  • Conversion fator for Unit of Measure in BI 7.0

    Hi Experts,
    Cud you pls tell me how Unit of measure conversion works in BI 7.0. I am getting dialog box of UOM conversion in the properties of BEX but not able to convert Conversion for Unit of measure?
    Thanks in advance!
    Sapna

    Hi,
    Better define Units of measure in that KF.
    Hope it helps.
    Regards,
    Tulasi

  • Conversion Problem in Unit of measure 1PAC=100,000 EA

    Hi Experts,
    I am facing the problem in conversion of Unit of Measures.
    If some material has the conversion unit when we order to Vendor.
    The Unit of measure is EA, the Order unit is PAC.
    The conversion is 1PAC=100,000 EA
    But the System is allowing as 1PAC=10,000 EA only and it is not allowing to enter 100,000 EA and throughing the error
    Entry too long (enter in the format __,___)
    Message no. 00089
    How can we increase the characters of the Unit of measure. Like this we have some 50 Materials, I need to increase the length of the conversion spaces. How to do it, Please guide me.
    rgds
    Swamy

    Hi
    you can check this out the denominator factor is Stored in structure - SMEINH - field UMREN.
    Best option is to maintain decimal place for the UOM , which is more easier to mainatin.
    Even if you go through the note the same is explained. Please read below for Too large numerators and denominators
    When 120000 CM3 = 0,2 tons (TO), you can no longer save numerator and denominator of conversion ratio 600000 CM3 = 1 TO as numerator and denominator may have maximally five digits.
    Here, you must either select a larger volume unit or a smaller unit of weight: With DM3 the conversion ratio would be 600 DM3 = 1 TO, with KG the conversion ratio would be 600 CM3 = 1 KG.
    Generally, the alternative units of measure and the base unit of measure should result in quantities that are in the same dimension since the conversion factors may not be larger than 99999/1 and not smaller than 1/99999.
    Thanks & Regards
    KK
    Edited by: Kishore Kumar Chiluka on Apr 22, 2008 8:25 AM

  • Conversion of alternate unit of measurement

    Hi,
    System will not allow to enter conversions of unit of measurements in decimal points. But is there any configuration or method, we can force system to accept conversions of unit of measurements in decimal points only? (For example 2.5kg = 1pc, base unit of measurement is 'PC' and alternate unit of measurement is 'KG')
    Regards,
    Sattuj

    Hi,
    For the given example of Alternate conversion you can use the following setting :
    2.5 Kg = 1 Pc
    Put the Values as :
    25 Kg = 10 Pc
    With this the objective of Decimal is achieved.
    Please check the following posts for more info :
    [Re: variable order unit]
    [Re: Base Unit of Measure]
    [Re: Issue in unit of measure]
    Hope it helps,
    Best regards
    Amit Bakshi

  • ABAP Unit for Function Module(Function Group)

    Hi, Gurus:
    Can we use ABAP Unit to test Function Module(Function Group).
    If can, give me a simple example. how to create methods. Thanks.
    Regards,

    I'm a little unclear about your question, Yunfa.
    Do you want to single-test a SE37 function-module? This can be easily done, just hit the F8 button, and it takes you to a single-test environment.
    Do you want to test an FM using an ABAP-program? This too is easy to do. To code the FM-call, there's a button called Pattern, in the standard SE38 screen, where you can put in your FM name, and it inserts the relevant code in your program.
    Note that if you're testing BAPIs using the single-test environment, the actual document posting will not happen, because that requires a BAPI_COMMIT_WORK call. So, the way to test BAPIs which post documents would be to write an SE38 program, which also calls the commit-bapi.
    Hope this answers your question!

  • How to convert in sytem Unit of Measure from PC to KG?

    Frds,
    If I want to convert after production my rejected or scrap material from PC to KG in SAP System? Here produced finish material is in PC unit of measure and I want it's scrap in KG?

    Dear,
    For conversion UOM,You can use Functional module with help of your ABAP team,
    Please refer below link-
    http://wiki.sdn.sap.com/wiki/display/ABAP/ToconverttheUnitofMeasuretoalternateUOM
    Regards
    Raheem

  • Reporting in Different Planning Unit of Measures

    Dear Gurus,
    I have a requirement where in the trasnaction happens at EACH and the users want to view the reports at the planning unit of measure. The different conversion factors for planning unit of measure are maintained as part of the product master. The product master contains the planning UOM as an attribute and the conversion factor as a key figure attribute. As of BW 3.5 i know that the alternate unit of measure is the funcationality which can handle this multiple units of measure functionality. But the white paper says that this functionality is available as a standard functionality in BI7. Can any one help me out in handling this scenario.
    Please also guide me as what i need to carry out before i start the actual development on this.
    Regards
    Vijay

    Upon further review I noticed that the Unit dimension is being correctly populated when the value is a monetary amount. For example $100 CAD, the CAD is populated in the Unit dimension for this key figure. The distance measurements (all KM) don't have anything.
    The UOM is present in both key figures in the bex query when run in Bex Analyzer.

  • ISO codes for Units of Measure

    are the iso codes held in the uom the standard codes?  are these sap standard or can these be amended to what is being output and received by the business for EDI?

    Hi Smith,
    Go through the below explanation, which would be helpful for you.
    Check units of measurement
    In applications you often have to make calculations with quantities and physical units. Units of measurement are needed for their screen display and for internal conversions (such as kilogram <-> gram, but also centimeter <-> inch). The international system of units (SI) is used for this.
    The international system of units is based on seven basic units of measurement. All other units are derived from these basic units. Units of measurement that measure the same quantity (and can therefore be converted into each other) are included in a dimension.
    Units of measurement are held centrally in the SAP System for all applications. The conversion factors are stored in the system with a unique internal key. The external display specifications are maintained for each unit of measurement language-dependently. A business key (3 characters) and a technical key (6 characters) should be maintained for each language.
    Standard settings
    In the standard delivery system, units of measurement are defined according to the international system of units (SI).
    For a new installation, units of measurement are delivered in all clients. For upgrades, new units of measuremente are delivered only in Client 000. They then still have to be transported to the production clients.
    Recommendation
    If you intend to perform cross-company data exchange, note that units of measurement with company-specific characteristics may have an adverse effect.
    Activities
    Check that the dimensions delivered and the associated units of measurements are complete.
    If you are using EDI, you should also check the ISO codes.
    Dimensions
    1. Call the maintenance transaction by double-clicking with the mouse on the Execute symbol.
    2. On the initial screen of the maintenance transaction, call the function Dimensions
    To get a definition of a dimension, place the cursor on the dimension and choose the function Details.
    3. If required, create new dimensions with the function New entries.
    Units of measurement
    1. Call the maintenance transaction by double-clicking with the mouse on "Execute", or press F3 to leave dimension maintenance and return to the initial screen of the maintenance transaction.
    2. Select - from F4 Help for the field next to the Units of Measurement function - the individiual dimensions, and choose the Units of Measurement function.
    To get a definition of a unit of measurement, position the cursor on the unit of measurement and choose the function Details.
    3. If required, define new units of measurement according to the international system of units (SI) with the menu function Unit of meaurement -> Create.
    Here you have to make make specifications for:
    Display (including a descriptive Units of measurement text)
    Conversion (not applicable to units of measurement without dimensions)
    Data exchange (EDI) (optional)
    Application parameters
    ISO codes
    1. Call the maintenance transaction by double-clicking with the mouse on "Execute", or press F3 to leave maintenance of units of measurement or dimensions and return to the initial screen of the transaction.
    2. Choose the function ISO codes.
    3. If required, maintain new ISO codes with the function New entries.
    Hope this helps.
    Thanks,
    Viswanath

  • How can i get currency values from flatfile to function module

    Dear All,
               I have to take  currency values from flat file and i have to assign those flat file value to function module .
    Eg: "Convert_to_local_currency".  I need technical code how to calculate those amount in work area and how to assign those amount value function module. 
              I need sample program for currency conversion from flat file to function module.  My requirement is based on flat file amount i have to calculate in work area and assign those work area to function module. 
    With Regards,
    Baskaran

    Hi Satish or Baskaran,
    First conform in which format the flat file is present, as abhi mentioned if it is there in notepad
    try to use F.M GUI_UPLOAD as shown below...
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
    FILENAME = 'C:\Desktop\rpf1.TXT'
    TABLES
    DATA_TAB =  ITAB.
    Now loop at ITAB Into Work_area and press the respect currency fields which you want and in the same way
    if the file is in EXCEL format use F.M ALSM_EXCEL_TO_INTERNAL_TABLE
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename = P_FNAME
          i_begin_col = 1
          i_begin_row = 1
        TABLES
          intern = ITAB
    LOOP AT ITAB INTO WA.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
            EXPORTING
              foreign_currency = wa-waers
              local_currency   = wa-waers
               IMPORTING
              local_amount     = tvals-gross.
        ENDIF.
    endloop.
    And as mentioned loop the records into work area and process the currenct field which is present in the
    ITAB according to its field name. And make sure within the loop you call your function module.
    Regards
    VEnk@
    Edited by: Venkat Reddy on Dec 9, 2009 5:51 PM

Maybe you are looking for

  • I need help with my DVD drive.

    After 4 hours of wandering around the net and not finding anything of use, I suspect I am posting on the wrong board. But hopefully somebody will do whatever is necessary to get this in the right place. Long story short, my Satellite A215-S4817 DVD d

  • Cant import my photos on pc

    hi I'm having trouble syncing my iPhone 4 to PC running windows 7. Since updating to the latest version of iTunes and updating to ios5 I cant import my photos when I plug in my iPhone it says in iTunes that it is syncing and it goes through the 8 ste

  • Can I block part of quantity of a material in a bin?

    Dears, I want to find a solution that blocking material partially in a storage bin in WM. Is there any standerd solution in WM? Please help! Thanks. Regards, David

  • Photoshop CS6 scratch disk on hard drive or SSD?

    I've purchased a Windows 7 PC with 16 MB RAM, 2 terabytes and a 250 GB SSD. I'm going to load Photoshop on the SSD and the OS on the hard drive. Where should the scratch disk go?

  • Wireless and broadband dropout

    Usual problem, have a Home Hub 2 that sometimes works at full wack then puts the breaks on and stops dead.  When it stops  all the computers connected wirelessly show a good signal level but no broadband content, most recently the stoppage has also a