Quantity field to one decimal place. PLEASE URGENT

I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
suppose: qty = 45.678
I want it to be printed as 45.7
Thanks in advance.

Create one more variable in Global definitions with only 1 decimal place.
Assign value of qty to this new variable.
SAP automatically takes care of the rounding.
And then print this new variable rather than qty.
You can write all these in a code block.

Similar Messages

  • Rounding a quantity field to one decimal place. PLEASE URGENT

    I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
    suppose: qty = 45.678
    I want it to be printed as 45.7
    Thanks in advance.

    Hi Riki,
    I think you can use Function Module ROUND to round off the value...
    REPORT ZTEST_SHAIL4 .
    data: out type p decimals 1,
    inp type f.
    inp = '45.678'.
    CALL FUNCTION 'ROUND'
    EXPORTING
    DECIMALS =
    input = inp
    SIGN = ' '
    IMPORTING
    OUTPUT = out
    EXCEPTIONS
    INPUT_INVALID = 1
    OVERFLOW = 2
    TYPE_INVALID = 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.
    Now use the variable 'out' to display the rounded off value...
    Regards,
    SP.

  • Change of the quantity field to 5 decimal places in SAP

    Hi Gurus,
    The quantity field is appearing with 3 decimal places in BOM, Process Order, etc. Is it possible to make the decimal places to 5.
    All the decimal digits from SAP are 3 digits. We have an interface through which the data flows from another legacy system (Fow system) to SAP. And the Fow system setting was 5 digits. The issue is some of the raw material requirement qty was really minor and it might be below the decimal 3 digits.
    In that case, when the data flows to SAP from Fow system it will cause the material stage failure. so please help me to investigate how to let the SAP also could have the 5 digits decimal. Thanks.
    Regards
    Brijesh

    Dear ,
    Its SAP standard ,to put and use decimal places in BOM qty .You can use upto 3 decimal places in BOM qty.
    At SE11 you need to see what measure field is linked to the quantity field.Then goto tranaction CUNI and chage the decimal places of the unit of measure for the qty field unit , it will not allow you more than 3 decimal places in case of BOM qty.
    You have following choice :
    1. With the access key make changes in the standard program and take help from ABAPer
    SAPLCSDI, Table Name-RC29P, Field Name- MENGE.
    2) Change the base quantity in BOM header to 1000 aand accordingly change the component quantity.
    Hope this is clear
    Regards
    JH

  • Amount has moved one decimal place in the report

    Hi,
    I am looking in to a report at present, Transaction amount has moved one decimal place, while the local amount stays the same. Any one could tell me the possible reason for this?
    Thanks in advance
    RN

    Hi,
    Check this link,
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/key-figure-in-cube-is-multiplied-by-100-when-displayed-in-bex-report-743076
    same issue find in this.
    Hope it will help you.
    Thanks,
    Hema

  • 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

  • Decimal places in quantity depending on currency

    hi
    i m doing an alv list display in which i need to display a quantity field with 3 decimal places for some currencies, but for one particular currency such as 'AED'
    that field should display only 2 decimal places in the output.
    regards
    Zarina

    Hi Zarina,
    Populate decimals_out with 2 for this field while building the fieldcatalog.
      g_t_fieldcat-decimals_out = 2.
    Note: don't declare the field as currency which will overwrite above setting.
    i.e., don't use g_t_fieldcat-cfieldname in this case.
    ==============================================
      g_t_fieldcat-seltext_s =  'USD Equi'.
      g_t_fieldcat-seltext_m =  'USD Equi'.
      g_t_fieldcat-seltext_l =  'USD Equivalent'.
    g_t_fieldcat-cfieldname = ' '.
      <b>g_t_fieldcat-decimals_out = 2.</b>
      g_t_fieldcat-just      =  'R'.
      modify g_t_fieldcat index zindx.
    ==============================================
    Hope this helps you.
    Regards,
    Vicky
    PS: Award points if helpful

  • Quantity Field Display

    Hi,
    I am displaying the quantity field in the sap script layout.But in the quantity field having 3 decimal places.
    Ex: 3.400 is there i want to display 3.4
        3.000 only i want to display 3
        3.740 -
      3.74 like that i want.
    I want to omit the zeros after decimal places.
    Please give me the solution.
    Regards,
    Jenny

    Hi Janardhan,
    Do one thing in your print program make us of following line of code
    shift wl_local right deleting trailing '0'.
    where wl_local will containing your quantity..
    This will solve your prob...
    Enjoy SAP.
    Pankaj Singh.

  • Quantity Field Display in Sap Scripts

    Hi,
    I am displaying the quantity field in the sap script layout.But in the quantity field having 3 decimal places.
    Ex: 3.400 is there i want to display 3.4
    3.000 only i want to display 3
    3.740 -
    3.74 like that i want.
    I want to omit the zeros after decimal places.
    Please give me the solution.
    Regards,
    Jenny

    As it is quantity field, it will print even the decimal points...U can try this...move the value to a char variable and use truncating to remove zeros by deleting them and use this value in ur script to print the value.

  • Decimal places not visble depending on unit of measure

    Hi,
       I have a fields in a table line that is a quantity field with 3 decimal places, I also have a unit of measure associated with that quantity.
    When my unit of measure is EA the quantity displays with 3 decimal places, but when the unit of masure is M it displays with NO decimal places. The display becomes very ugly when there is a mixture of units of measure.
    Anyone know why thsi is happening?
    Cheers,
    Ross

    I'd suggest that there is a conversion routine specified on the domain of the amount field - probably "CUNIT" which takes the value of the unit, looks it up in T006 and then applies relevant formatting to the field.
    This isn't really a WDA thing - it's nice that WDA does this (well perhaps not in your case but it is standard behaviour for amounts and unit fields.
    Cheers,
    Chris

  • Validation of a quantity Field gives a run time dump

    I have an upload file which provide me with a quantity input field which i needs to validate for non characters and special characters.
    I have used a code which does a validation for the character or special character entry in the field but i am not able to check for '.' in the entry.
    the problem is if the user by mistake enters two decimal point which should only be one; the program goes for a dump.
    the below given code is what i have used for validation of the quantity field.
      IF NOT wa_final-actual_quan IS INITIAL.
        MOVE wa_final-actual_quan TO l_fld_quantity.
        TRANSLATE l_fld_quantity TO UPPER CASE.
        IF l_fld_quantity CA sy-abcde OR
                          l_fld_quantity CA '!~@#$%^&*"?><`|}{[]()+-='.
         *giving an error message
          v_flag1 = c_x.
        ELSE.
          CLEAR: l_fld_quantity1,l_fld_quantity2.
          SPLIT l_fld_quantity AT '.' INTO
                                      l_fld_quantity1 l_fld_quantity2.
          CONDENSE l_fld_quantity1.
          l_len = strlen( l_fld_quantity1 ) .
          IF l_len LE 10.
            IF NOT l_fld_quantity2 IS INITIAL.
              l_len1 = strlen( l_fld_quantity2 ).
              IF l_len1 LT 2.
              CONCATENATE l_fld_quantity2 '0' INTO l_fld_quantity2.
              ENDIF.
              CONCATENATE l_fld_quantity1 '.'  l_fld_quantity2(2)
                                          INTO l_fld_quantity3.
              CONDENSE l_fld_quantity3.
            ELSE.
              CONCATENATE l_fld_quantity1 '.' '00'
                                          INTO l_fld_quantity3.
            ENDIF.
            wa_zphyin-acqty = l_fld_quantity3.
    the requirement is that if the user enters the input for quantity it should only accept one decimal place in the field and if by mistake he enters 2 decimal points it should give an error stating :- invalid input for quantity.
    experts please guide as to how i can overcome the problem.
    helpfull amswers will be rewarded.

    Use try..catch..endtry block to handle the error.
    REPORT  Z_TEST2.
    data: l_num type p decimals 2.
    parameter: p_value type char10.
    start-of-selection.
    try.
    l_num = p_value.
    catch cx_root.
    write: 'Not numeric'.
    exit.
    endtry.
    write: 'Numeric'.
    Regards,
    Joy

  • Problem while changing decimal places in SAP B1 2007

    Hi Experts,
    I want change the decimal places of Quantity type fields from 2 decimal places to 4 decimal places. But while changing it in Genral settings form ,it shows the error message "Cannot update while another user is connected to the company". it is working in SAP B1 2005B but not in SAP B1 2007
    Please help me if you have any solution on this issue..
    Thanking you in advance

    Paul,
    Please see SAP Note 1247060 as is discusses the fact that this did work in 2005, but the behavior was changed in version 2007 ...
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&;note_numm=0001247060
    Eddy

  • Printing to 2 decimal places

    i have my database in mysql and my field total is declared as decimal to 2 decimal place.....how to i get it to print to two decimal place in my JSP page...i have declared the variable as double but when it is printing it is printing to one decimal place only...please help

    don't declare ur column as decimal in MySQL . Declare as decimal(3,2);
    thanx,
    Samir

  • Difference of decimal place in SAP R/3 and BW

    Hello SAP experts,
    I am extracting purchasing data from SAP R/3 using datasource 2LIS_02_SCL.
    In BW I see a difference of one decimal place.
    In RSA3  amount is shown as 17.350,00
    Whereas in PSA above value is displayed as 1.735,000
    Decimal notations are same in both R/3 and BW.
    Please help me to understand the reason behind difference in values.
    Thanks and Regards
    Shilpa

    Hello All,
    The issue is resolved. The difference in Amount is due to different decimal configuration settings in TCURX table in both R/3 and BW. Ideally these settings should be same in R/3 and BW. If decimal settings doesn't match misalignment has to be taken care of either in ETL or during query design.
    Thanks and Regards
    Shilpa

  • 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

Maybe you are looking for

  • How can I sort my photos by title on the iPad

    Who kows, how I can sort my photos by title on my iPad. In my mac in iPhoto I can do so, and there are several options to sort. When I chose "sort by title on iPhoto, they are displayed in the wright way, but only on the mac not after sync. on my iPa

  • How do I turn off the annoying voice on Apple TV.

    How do I turn off the very annoying voice to come on when I use Apple TV. I did not have this when I first set it up but had to reset the apple tv as my Netflix wa not working?

  • Registry error after launching Photoshop 6

    I have a user who is getting a dialog box that says Registry editing has been disabled by your administrator.  This started happening after I copied the original user profile who had had administrator access to a new profile with power user access. 

  • Messages displayed in the Approval and message tab in SRM approval is same

    Hi, We are having an issue with the message displayed in the approval step.When we click on the approval option in SRM, we get two tabs displayed Approval and Messages. The content displayed in both the tab is same for one user. Generally the content

  • Viewing PDF files in iBooks ?

    does anyone know if there is anyway to view PDF files as you view books in ibooks with access to all options (copy, define, highlight, note, search, share) ?, thank you.