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

Similar Messages

  • How to handle different Unit of measures in ALV reports? Quantity/Price

    Anyone knows how to handle different unit of measures for quantity or price in hierarchy ALV reports?

    hi,
    use the below fields:
    Link to measurement unit
    •qfieldname (measurement unit field name)
    only relevant for quantity columns with unit link.
    Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME.
    The field in FIELDCAT-QFIELDNAME must have its own field catalog entry.
    •qtabname (internal measurement unit field output table)
    value set: SPACE, output table field name
    Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
    regards,
    madhumitha

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

  • 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

  • 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

  • Report on material code, description and all unit of measure conversions

    report on  material code, description and all unit of measure conversions ?
    any ideas?

    Material Number MATNR
    with this key and SPRAS (the desired Language key)
    from MAKT you can get the descriptions..
    and with MATNR from MARM you can get alternative UOM and the conversion rates.
    If you need help on MARM how to get the conversions please notify.
    Hope it helped
    Please reward if found useful
    Best Regards

  • Unit of measure conversion for CIN is not relevant for pricing

    During creation of Ad item type order, when we enter the planned ad size e.g. A CO (Columns) x B IN (Inches), the system is showing a message "Unit of measure conversion for CIN is not relevant for pricing" and pricing is not determined in the Billing Data Set. However if the planned ad size is maintained as A CO (Columns) x B MM (Millimeters), there is no impact to pricing conditions.
    Any light how to fix this issue?
    Thanks,
    Suseela. V

    Dear Suseela,
    You need to maintain Unit of conversion using transaction code JH51. You have to follow the path Logistics-Advertising Management-Master Data-Conditions-Order/Billing Document-UM for Pricing.
    Here you can maintain combination using Booking Unit, Content Component, Design type and assign Unit of Measure to get relevant pricing into billing set conditions.
    Hope it will help. Thanks!
    Regards
    Indra

  • ECC6 - ALV Grid Output Conversion Exit

    Hi,
    I'm creating a program in ECC6 to display the report in ALV grid by called FM: REUSE_ALV_GRID_DISPLAY.
    EG: Select field (TPLNR) from table IFLOT. Value retrieved are: ?0100000000000000029. However, the output doesnt do the conversion exit to change the TPLNR value to format MY.FO.001.
    I did the same in 4.6C system, the ALV report able to display the correct value of TPLNR. Eg: MY.FO.001 instead of
    ?0100000000000000029.
    If anyone encountered the same issues in ECC6 system which In an ALV grid, it doesnt to display data that is based on a domain with a conversion exit?

    Hi Simone,
    Check this NO_CONVEXT in the Structure LVC_S_FCAT. Populate with SPACE in the FCAT Build.
    If you have conversion Exit to that field then use the CONVEXIT in the same structure while building Field Catalog. sometimes you have Z converions so you need to check this.
    If you a Table field in the FCAT then you dont need all these things. because conversion exits are automatically done. Also COL_OPT = 'X' this will align the ALV in the correct format for output. hope this helps.

  • Error in units of measurement conversion  "BOM"

    hello gurus gudmorning everybody
    i have problem in  project regarding the units   of  measurement conversion BOM
    this is the scenario: 1000 ft2(  BASE UNIT MEASUREMENT)  = 1ea (    SALES UNIT) ( 2bed room flat) it is a higher level item
    sub items are in EA  base unit measurement ex: like  one sofa one air conditioner etc instead of taking sale unit measurement of higher level item , its taking base unit mesurement of higher level item , .i.e instead of taking 1EA  2bhk = 1AC, 1 SOFA,   but is calculating 1000ft2( 2bhk)   = 1000ac, 1000sofa , plz help out to rectify the conversion
    thank you in  advance
    venkat

    Dear Venkat,
    Try with this
    Please maintain the alternative unit of measure in sub itemes master data at Additional tab like this
    in AC master data 1EA = 1AC and 1AC = 1EA 2BHK
    in Sofa master data 1EA = 1 Sofa and 1Sofa = 1EA 2BHK
    Now you try
    I hope this will help you,
    Regards,
    Murali.

  • Unit of Measure Conversions.

    Hi All, I have Unit of Measure Conversion requirement in my reports, I would like to create a variable and user has an option to choose the Target UoM.
    For this I have referred RSUOM T-Code and got an option to create Target UoM Variable (Specifying Target UoM using a variable) but here my proble is, have to do conversion across dimensions as below.
    Unit of Measure conversions that I have across dimensions (all conversions both ways):
    tonne to kilotonne
    1000 GJoule to Million GJoule
    kilotonne to Million tonne
    tonne to Million tonne
    kilogram to tonne
    tonne to barrel
    kg to liter (spill)
    tonne to gallon
    Could anyone tell me, is it possible to do conversion Across dimensions? (i.e Mass to Volume), if itu2019s possible where we need to maintain the conversion values.
    I am not able to see any table which holds the values of Unit of Measure, I saw T006 but could not able tofind any info.
    Thanks in Advance.

    Hi Kalyan,
    To convert from kg to litres you need material specific information like relative density .
    It can not be done with common values in UOM-conversions.
    e.g. the relative density for lead (11.35 kg/ litre) is different from the relative density for water (1 kg/litre)
    1 tonne = 1000 kgs for every material.
    Udo

  • Multiple Unit of Measure (No Fix Conversion Formula)

    Dear All,
    Cilnet has given me requirement to book the sales document for the particualr product in unit of mesure 'Nos/PC', and the stock is maintained in Base Unit of Measure 'Qtl' (100 Kg = 1 Qtl). Price is also applicable or calculated on the basis of QTL but there is no fix conversion formula of 1 PC = How Many QTL.
    Please guide me on this point.
    Regards
    Rahul

    Hi,
    I was facing the same Problem  ,well for this you need to define a character and associate the same to a  Class .
    And Finally need to assign Combination of these to material in material master classification view.
    Define Charter :
    http://wiki.sdn.sap.com/wiki/display/PLM/Howtocreateacharacteristic
    Assign the Char to Class :
    Tcode : CL02
    Under Char Tab Give the Charcter Name and Place "S" in Org. Area.
    Thanks.
    Edited by: C.Ankit on Mar 7, 2012 8:18 AM
    Edited by: C.Ankit on Mar 7, 2012 8:18 AM

  • Unit of measure conversion during backflushing

    Dear All,
    The BUOM for one component in our industry is in KG whereas in Bom it is defined in G(grams) due to very low consumption qty & I have maintained conversion in material master additional data tab already but on backflushing the system is putting this item in COGI such as .350g(which becomes .00035KG in base unit because as per std only 3 decimal places are allowed in BOM ) so the error text qty in stock keeping unit is zero in COGI is generating & the system is not posting this qty in consumption pls. help to resolve this because i can not change my base unit from KG to G.
    Regards
    Rakesh Sehgal

    Hi Sehgal,
    As the KG and Grams belong to same Unit, you need not maintain the alternate unit of measure in Material Master, additional tab screen.
    Only thing which is required to maintain is In Basic View maintain the BUOM as "KG" anh in Work scheduling view maintain the Issue Unit as "G". and Also in BOM you maintain the UOM as "G".
    Your issue will be resolved.
    Do the above and check and let us know
    Regards
    radhak mk

Maybe you are looking for

  • Error occurred during initialization of VM

    im new to jdeveloper please anyone help me... Starting WLS with line: C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer -Djava.security.policy

  • And on the 15th day.....

    Maybe someone here can help, or by luck someone from VZ will see it and actually  be able to help me. Although I don't have my hopes high.  15 days ago I got my TB, 16 today, but I was too mad to seek help on here yesterday. I'm coming from a Droid P

  • Mail App connecting to Exchange via IMAP - Address Book Images

    Not a life or death problem, I have multiple accounts in Mail App - some using POP3, Some using IMAP. The IMAP accounts don't show Address Book images at all. The POP3 accounts are fine. Odd one, any ideas why?

  • Re: "why do I have to keep re-installing flash?"

    I finally figured out why I was having to re-install flash so often. It was happening every time I ran C-cleaner...

  • StarOffice 8 - Language / Spellcheck issue

    StarOffice 8 came installed with my new notebook. The spellcheck function doesn't seem to work at all... Tool - Options - Language Setting - Languages... are all set to English (USA) but no errors are being auto-detected and when spellcheck is initia