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

Similar Messages

  • 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

  • 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

  • ALV QUANTITY field Geting converted into decimals ?

    Hi All ,
    I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
    Best Regards,
    Sreeram

    Hi Sreeram,
    I am not gettin this issue. See below code :
    If you are gettiing the same issue with the below code then it has something to do with your user settings.
    Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
    Set it to 1,234,567.89 and save. Now try the program again.
    REPORT z_test.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF ty_ekpo,
              ebeln TYPE ebeln,
              ebelp TYPE ebelp,
              ktmng TYPE ktmng,
              menge TYPE bstmg,
            END OF ty_ekpo.
    DATA: it_ekpo TYPE TABLE OF ty_ekpo,
          it_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT ebeln ebelp ktmng menge
      FROM ekpo
      INTO TABLE it_ekpo
      UP TO 20 ROWS.
    PERFORM add_fieldcat USING 'EBELN'.
    PERFORM add_fieldcat USING 'EBELP'.
    PERFORM add_fieldcat USING 'KTMNG'.
    PERFORM add_fieldcat USING 'MENGE'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = sy-repid
       it_fieldcat                       = it_fieldcat
      TABLES
        t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    FORM add_fieldcat  USING  p_fieldname TYPE slis_fieldcat_alv-fieldname.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-tabname = 'IT_EKPO'.
      wa_fieldcat-ref_fieldname = p_fieldname.
      wa_fieldcat-ref_tabname = 'EKPO'.
      IF p_fieldname EQ 'KTMNG'.
        wa_fieldcat-edit = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " ADD_FIELDCAT
    Regards,
    Jovito

  • Quantity field in ALV

    Hello All,
          I am using OO - ALV in which I am displaying a quantity field.This field is an editable field and if user tries to change the value and SAVE , it is taking some wrong values.
    Say suppose I am having 1.000 as the initial value and if user changes it to 2.000 and saves it is converted to .002.
    I tried with qfieldname , ref_fieldname of fieldcat but of no use. Anything apart from this will be highly appreciated.
    Regards,
    Dhwani

    User might be changing the value to only 2 and you might have declared the fieldcat with 2-3 decimal places. If you enter value with decimals say 2.001 it will take.
    Otherwise you need to replace it with char value as Nanda has suggested.
    Hope it helps.
    Thanks,
    Jayant

  • Problem with  the quantity field in bdc?

    Hi,
    i have to populate a quantity field in bdc .
    for ex 123.00. but the bdc accepting only in the form of 123,00.
    How can I do this .
    I tried by changing the user profile, but went in vain.
    Suggest me how to convert ?
    Thanks.

    Hi,
    Create a variable of TYPE CHAR.Write your quantity field value into this variable and pass this variable to the BDC. This is the way of passing quantity fields to BDC.
    DATA: V_AMOUNT(22) TYPE C.
    WRITE ITAB-DMBTR INTO V_AMOUNT.
    Pass this V_AMOUNT to BDC flow.
    Hope this helps.
    ashish

  • Quantity field to be shown on 1ST line only for purchase order items in ALV

    Dear All,
    I am fetching data from purchase order history table (EKBE) where PO line items contains multiple times. User does not want to view  fields that are repeating multiple times in all lines, but in the top line. By sorting the same in ALV , I can do the same with character type fields, but how to do the same with quantity fields. One way out is converting the same into character fields. Is there any other way. Please give me some solution. Also while sorting , the number which gets repeated (i.e Items in PO for different PO's ) does not gets displayed. I want my program to display them.
    Thanks,
    Debopriyo Mallick

    Try this
    loop at ist_mseg into wa_mseg.
      ON CHANGE OF wa_mseg-con.
        move '111' to wa_mseg-con1.
        modify ist_mseg from wa_mseg.
      ENDON.
    endloop.
    loop at ist_mseg into wa_mseg.
      if wa_mseg-con1 ne '111'.
        move 0 to wa_mseg-menge.
        move 0 to wa_mseg-netpr.
      endif.
      modify ist_mseg from wa_mseg.
    endloop.
    mseg-con is the concatenation of ebeln and ebelp values.
    pk

  • 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

  • Problem with quantity field in BDC

    hi experts,
                   i am trying to upload  data from internal table to SAP using BDC, but while uploading quantity fields it is giving error as "Input fields is longer than screen field", Is there any method to upload quantity fields to SAP.
                     thanks in adancae,

    Hi,
    Before passing the value to perform bdc_field, convert that value to char type
    For eg.
    DATA :        v_val(10)               TYPE c,
      v_val = wa_operation-std_value_01. CONDENSE v_val.
      CONCATENATE 'PLPOD-VGW01(' n_linecount1 ')' INTO v_para.
      PERFORM f_bdc_field       USING v_para           v_val.
    FORM f_bdc_field  USING fnam fval.
      CLEAR wa_bdctab.
      wa_bdctab-fnam = fnam.
      wa_bdctab-fval = fval.
      APPEND wa_bdctab TO it_bdctab.
    ENDFORM.                    " f_bdc_field
    check this it would be useful.

  • Quantity field for user input in interactive alv

    hi,
    i have created an interactive alv report that allows user to key in quantity fields using fm "REUSE_ALV_LIST_DISPLAY'. then quantity field is referred to MARD-LABST for instance, with 3 decimals point. When i tried to key in quantity as '9', it then will be converted into 0.009 by using cl_gui_alv_grid->check_changed_data( ). May i know what the root causes are and also how to resolve it using same fm??? Thanks.

    Hi,
    In the field catalog, for the field set the attribute DECIMALS to 3.
    This should resolve your issue.
    Regards,
    Sagar

  • How to display Quantity fields in Table control

    Hi,
    I need to display quantity fields in my table control based on the resb-meins field. i.e. I need a feature similar  to qname of ALV Grid Control in Table control.
    Can any body help me.
    Regards,
    Srinivas

    hi,
    use the charecter filed and   convert u field in to charecter
    check this link
    Re: character to decimal conversion
    ~linganna

  • Reg: Quantity field taking as decimal values

    Dear Experts
    In the Bapi BAPI_SALESORDER_SIMULATE the structure BAPIITEMIN contains a field Req_qty that has the data element WMENGC which is taking the input with 3 decimal points even though the domain doesnt contains any decimals, because of this im facing the problem while giving the input.
    Is there any functional requirement to avoid that quantity field taking those 3 decimals
    eg: Original Value: 1000
          Input Value(Converted Value)    : 1.000
    Kindly suggest me a solution to sort out the issue.
    Regards
    Arun.P

    well i suspect that this bapi also has a currency field, which you should fill.
    If he knows the currency he should be able to find out how much decimals there are customized for this currency, and then probably he will do it right.
    oh lol you are talking of quantities and not values... sorry forget about my comment...
    Edited by: Florian Kemmer on Jul 22, 2010 2:37 PM

  • Rounding quantity field

    Hi All!
    I want to round quantity field to one decimal place instead of three decimal places.How to achieve this I know there is FM to convert to 2 decimal places but how to get it for one decimal place.
    Regrads
    Praneeth

    <b>WRITE .... <f> <option>.
    U can use into another field</b>
    Formatting options for numeric fields
    Option
    Function
    NO-SIGN
    The leading sign is not displayed on the screen.
    DECIMALS <d>
    <d> defines the number of digits after the decimal point.
    EXPONENT <e>
    In type F fields, the exponent is defined in <e>.
    ROUND <r>
    Type P fields are multiplied by 10**(-r) and then rounded.
    CURRENCY <c>
    Format according to currency <c> in table TCURX.
    UNIT <u>
    The number of decimal places is fixed according to unit <u> specified in table T006 for type P fields.
    DATA pack TYPE p VALUE '123.456'
                            DECIMALS 3.
    WRITE pack DECIMALS 2.
    WRITE: / pack ROUND -2,
           / pack ROUND -1,
           / pack ROUND 1,
           / pack ROUND 2.
    output
    123,46
    12.345,600
    1.234,560
        12,346
         1,235
    regards
    vinod

  • About Currency and Quantity Fields

    How does the Currency and Quantity fields are set to a field in a Table, created in SE11
    can you please send examples of each
    Thankyou

    hi,
    its same like any other field.
    but one difference :- <i>the reference field is requires.</i>
    <i>why reference field?</i>
    The reference field is used for the output, the output/input format of a currency field depends on the value of its reference field.
    For example if you create a screen using the field KONV-KBETR :
    the reference field is RV61A-AWEI1:
    if you set RV61A-AWEI1 = 3
    the value in KONV-KBETR is beeing shown with 3 decimals
    So you could see 3,000 but this value is automatically stored as 30.00
    if you set RV61A-AWEI1 = 2
    the value in KONV-KBETR is beeing shown with 2 decimals
    All this convertions are automatically made in according to the value setted in reference field.
    You can see this using the statament WRITE with options CURRENCY, try this:
    PARAMETERS P_KBETR LIKE KONV-KBETR.
    WRITE: P_KBETR CURRENCY '3'.
    WRITE: / P_KBETR CURRENCY '2'.
    WRITE: / P_KBETR CURRENCY '1'.
    Hope u gor the idea
    Rgds
    Anver

  • Incorrect result of multiplication for quantity fields,coverting LB to KG.

    Hi All,
    The requirement is to convert LB(pounds) to KG.The formula goes as follows.
    l_ntgew = vbap-kwmeng   *  w_mara-ntgew *  l_zcazz  .
    l_brgew = vbap-kwmeng   * w_mara-brgew  *  l_zcazz  .
    where kwmeng = '1' is ordered quantity,w_mara-ntgew = '0.157' is the net weight from mara and l_zcazz ='0.454'  is the conversion factor from LB to KG.
    This information is for material mara-matnr = '100014609'
    The result I am getting is l_ntgew = '71278.000' which incorrect.
    Actual result is = '0.071278' .
    Similar issues with l_brgew.
    The same code works fine in a custom program but the requirement is to modify userexit 'userexit_check_vbap using us_dialog' within include 'MV45AFZB'.Here it fails completely. We have tried all types of field declarations, be it float or packed or ntgew_ap(quantity field).
    Please help.Its urgent.Full points will be awarded to the correct solution.
    Thanks,
    Shamia.

    VBAP-KWLMENG is a quantity field associated with unit VBAP-VRKME. (sales unit)
    Try to use FM to convert quantithy from sale unit to base unit
            call function 'MD_CONVERT_MATERIAL_UNIT'
                 exporting
                      i_matnr              = vbap-matnr
                      i_in_me              = vbap-vrkme
                      i_out_me             = mara-meins
                      i_menge              = vbap-kwlmeng
                 importing
                      e_menge              = <qty in base unit>
                 exceptions
                      error_in_application = 1
                      error                = 2
                      error_message        = 3
                      others               = 4.
    Then multiply by <b>mara-ntgew</b> giving a result in unit <b>mara-GEWEI</b> then convert from this unit to KG. (same FM)
    Regards

Maybe you are looking for

  • Why does my MacBook Pro randomly go to sleep?

    Hey everyone. I just recently noticed that in the middle of doing normal things on my MacBook Pro, it goes to sleep randomly. I have the 2.4ghz 13" 2010  model. It happened twice so far within a 10 minute period. It has happened while charging throug

  • Package DBDOM error ...

    I am trying to run one of the sample programs. I am getting this error: SQL> exec InsertDeptFromXML('<DEPT><DEPTNO>60</DEPTNO><DNAME>Sixty</DNAME></DEPT ');BEGIN InsertDeptFromXML('<DEPT><DEPTNO>60</DEPTNO><DNAME>Sixty</DNAME></DEPT>'); END; ERROR at

  • Import Failed (Placing InDesign Files in InDesign CS6)

    I'm trying to place about 100 different ads in InDesign format into my InDesign CS6 document. The last couple years I've done this with CS4 without any issues. However, this year I'm using CS6. Now I'm running into the "Import Failed" error message a

  • Apache and webLogic Communication

    Hi we are deploying new application and client want to have Apache on one server and weblogic on another server. Can you pls point to any notes/docs which tells how to configure Apache to have as fronend for applications in weblogic. Thanks Sree

  • Problems installing Flash player on my mac

    I tried to install the latest version of flash on my i-mac. It didn't work so I followed the directions and uninstalled the old version. Now I cannot install the new version. The icon just bounces in the dock and won't respond. I've tried shutting do