ALV output is 2 decimal places, but prints as 3

Hi,
In my current ABAP program, the output is shown as 2 decimals, using the following domain:
Data Type: QUAN
No. Characters: 13
Decimal Places: 2
Output length: 17
However, during unit testing, it was found that during printing, instead of printing it out as 2 decimals (ex. 12.00,) its printed out as 3 decimals (ex. 12.000.)
The same thing can be noticed when using Print preview. It starts at the editable fields and continues onward to others.
Why is this occurring and what can I do to fix this problem?
Points will be rewarded and all help will be greatly appreciated.
Thanks,
John

Hi
Check once again the attributes of that Qty field in Dataelement and domain
Because for all QUAN type fields it is always 3 DECIMAL places
you are saying it is 2
check it
All the qty fields in SAP with data type QUAN uses/prints 3 decimals
so check and  see
like fields LFIMG.MENGE,FKIMG,KWMENG all fields with 3 decimals
Reward points for useful Answers
Regards
Anji

Similar Messages

  • Display amount in ALV Grid with different Decimal Places based on Currency

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2.
    we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65
    i need to display values like AED : 22.56

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2. we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65 (converting this value to 22.565 using BAPI_CURRENCY_GETDECIMALS according to currency in my Report)
    i need to display values like AED : 22.56
                                             KWD---22.565 but here field is NETWR with 2 decimal.
    Need to Display amount in ALV Grid with different Decimal Places based on Currency
    Regards,
    Dileep Kumar Reddy

  • Help wanting to limit output to 2 decimal places :O

    im trying to make it so i only output over 2 decimal places.
    here is my code. can someone tell me what to add? thank you mucho
    package javaapplication2;
    import java.util.*;
    import cs1.Keyboard;
    public class Main {
    public static void main(String[] args) {
    double Hours_Worked,
    Hourly_Wage,
    Total_Money;
    final double COMMISSION = 3.59 * .1;
    int noSoldFish;
    String UserName;
    System.out.println("Please enter the employee's name: ");
    UserName = Keyboard.readString();
    System.out.println("Please enter hours worked by employee: ");
    Hours_Worked = Keyboard.readDouble();
    System.out.println("Enter employee's hourly wage: $");
    Hourly_Wage = Keyboard.readDouble();
    System.out.println("Enter the number of fish sold by employee:");
    noSoldFish = Keyboard.readInt();
    Total_Money = Hours_Worked * Hourly_Wage + noSoldFish * COMMISSION;
    System.out.println("\n===========================================" +
    "\n Employee's Information" +
    "\n===========================================" +
    "\n" + UserName + " worked " + Hours_Worked + " hours this week" +
    "\n" + UserName + " makes $" + Hourly_Wage + " per hour." +
    "\nThe total salary and commission for "
    + UserName + " is $" + Total_Money);
    System.exit(0);
    }

    read up on, or search the forum on NumberFormat and in particular the factory method NumberFormat.getCurrencyInstance(); This is what you need here.

  • Download amount value without decimal place but element with decimal place

    Hi all,
    to display the amount without decimal places in classic report, i can use this way which is wa_wrshb NO-ZERO CURRENCY wa__waers.
    may i know,
    1) how to display amount in ALV where amount value (which using dmshb/wrshb) has no decimal place like JPY?
    2) what should i do if i want to download the amount value which field using dmshb or wrshb that the value has no decimal place like JPY?
    Thanks

    Hello,
    You can display the ALV output according to the decimal point in the currency.
    When creating the field catlog for the amount field add the currency parameter also.
      wa_fieldcat-fieldname     = <amount_field>.
      wa_fieldcat-tabname       = <output_table>.
      wa_fieldcat-seltext_l     = <column_heading>.
      wa_fieldcat-outputlen     = p_olen.
      wa_fieldcat-currency      = wa_waers.              " This will work same as CORRENCY wa_waers
    Regards
    DKS

  • How can I stabilize the DAQ output to four decimal places

    I have a daq 6009. I sent a optical signal. DAQ provides a output which varies in 3rd  decimal place. I done averaging all using a program which I'am attaching with this. So can you please help me in this regard 
    Attachments:
    data acquisition 2 (SubVI).vi ‏71 KB

    You need to find a DAQ with a lower Absolute Accuracy.
    Also, looking at the spec, you can get a better accuracy with a Differential measurement than you can with a RSE.  Apparently the RSE only works in the +-10V range.  By changing to a differential, you can get down to a +-1V range.  That will help your resolution a little bit.  Just wire the ground to the - terminals on the DAQ.
    Another issue could be noise in the system.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Need only two decimal places, but BigDecimal isn't working

    Hello again. This time I've got a problem with getting only two decimal places. I tried using BigDecimal but when I compile it, I get an error "cannot find symbol class BigDecimal" and a "cannot find symbol variable BigDecimal".
    Grrr... I just want my value to have only 2 decimal places before it ends up in my text field.
    Any help will be appreciated.
    - Phonse
    if (ostuff1.equals("amt tendered"))
                     finalamt = total1 * 1.12;
                     change = cash1 - finalamt;
               BigDecimal finalamt2 = new BigDecimal(finalamt);
                  finalamt2 = finalamt2.setScale(2, BigDecimal.ROUND_DOWN);
                  BigDecimal change2 = new BigDecimal(change);
                  change2 = change2.setScale(2, BigDecimal.ROUND_DOWN);
                  finalamt = doubleValue(finalamt2);
                  change = doubleValue(change2);
                     addItem(String.format("Amount Tendered:          "+"P "+finalamt));
                     addItem(String.format("Change:                     "+"P "+change));
                   }

    @ georgemc
    Isn't it better to import whole packages instead so
    you can have everything available when you call them?
    I mean, it's kinda hard to import individual classes
    everytime you need to call them.No. You can get conflicts when importing complete packages. If you importjava.awt.*;
    java.util.*;and then declareList list;the compiler does not know which List you meant, java.util.List or java.awt.List.
    Offtopic @ prometheuzz
    LOL. When I was a kid still playing my Playstation I
    wanted to have a career in computers when I got to
    college. Now I'm 14 and a 3rd year high school
    student and I just got a reality check -- computers
    just isn't for me. And alot of those professionals
    say Java is the "easiest" programming language. O_O
    Meh. I'll just follow my other dream of becoming a
    chef. Just seems like my parents won't like it...
    Bleh... Two more years... Two more years...Sure, but if you like programming, work (hard) for it. Most people have to work hard in order to become good at something, no one is born as a programmer. This goes for becoming a chef as well.

  • Help with limiting JOptionPane output to 2 decimal places

    I don't seem to be able to figure out how to specify 2 decimal points in my output to a JOptionPane. I know how to do this in a standard program with no gui interface but I have been unsuccessful in my attempts with JOptionPane. I have included my code below and any assistance at all would be appreciated.
    import javax.swing.JOptionPane;
    public class Vehicleanalysis2
    public static void main( String args[] )
    String januaryRepairs =
         JOptionPane.showInputDialog( "Enter January's repair costs:" );
    String februaryRepairs =
         JOptionPane.showInputDialog( "Enter February's repair costs:" );
    String marchRepairs =
         JOptionPane.showInputDialog( "Enter March's repair costs:" );
    String aprilRepairs =
         JOptionPane.showInputDialog( "Enter April's repair costs:" );
    String mayRepairs =
         JOptionPane.showInputDialog( "Enter May's repair costs:" );
    String juneRepairs =
         JOptionPane.showInputDialog( "Enter June's repair costs:" );
    String julyRepairs =
         JOptionPane.showInputDialog( "Enter July's repair costs:" );
    String augustRepairs =
         JOptionPane.showInputDialog( "Enter August's repair costs:" );
    String septemberRepairs =
         JOptionPane.showInputDialog( "Enter September's repair costs:" );
    String octoberRepairs =
         JOptionPane.showInputDialog( "Enter October's repair costs:" );
    String novemberRepairs =
         JOptionPane.showInputDialog( "Enter November's repair costs:" );
    String decemberRepairs =
         JOptionPane.showInputDialog( "Enter December's repair costs:" );
    double january = Double.parseDouble(januaryRepairs );
    double february = Double.parseDouble(februaryRepairs );
    double march = Double.parseDouble(marchRepairs );
    double april = Double.parseDouble(aprilRepairs );
    double may = Double.parseDouble(mayRepairs );
    double june = Double.parseDouble(juneRepairs );
    double july = Double.parseDouble(julyRepairs );
    double august = Double.parseDouble(augustRepairs );
    double september = Double.parseDouble(septemberRepairs );
    double october = Double.parseDouble(octoberRepairs );
    double november = Double.parseDouble(novemberRepairs );
    double december = Double.parseDouble(decemberRepairs );
    double annualrepaircost = january + february + march + april + may + june + july + august + september + october + november + december;
    double payment = annualrepaircost / 12;
    if (annualrepaircost <= 3600 )
         JOptionPane.showMessageDialog(null, "          Keep your car.\n          Your monthly repair\n          costs only average\n           out to be: " + payment + "\n          Your annual repair costs\n          this year\n were: " + annualrepaircost, " Recommendation", JOptionPane.PLAIN_MESSAGE );
    else
         JOptionPane.showMessageDialog(null, "          You should consider purchasing a new\n          car if you can get a payment\n          for less than: " + payment + "\n          Your annual repair costs\n          this year\n          were: " + annualrepaircost,
         " Recommendation: ", JOptionPane.PLAIN_MESSAGE );
    }

    Hi,
    try the following:
    double payment;
    JOptionPane.showMessageDialog(null, String.format("Payment: %.2f ", payment));
    /Mattias

  • Output to 2 decimal places

    Hi there,
    Got a small problem the output's are coming out like this 155.5 and i need them to come put like this 155.50
    <cfparam name="FORM.twin" type="string" default="1" />
    <cfquery name="twin" datasource="strand">
    SELECT *
    FROM hotel_rooms
    WHERE hotel_rooms.ID = 1</cfquery>
    <!---Twin CFIF--->
    <cfif form.twin gt "0" and form.nights eq "1">
    <cfset tprice = 1*#twin.price_night1#>
    <cfelseif form.twin gt "0" and form.nights eq "2">
    <cfset tprice1 = 2*#twin.price_night1#>
    <cfset tprice = #tprice1#*0.95>
    <cfelseif form.twin gt "0" and form.nights eq "3">
    <cfset tprice1 = 3*#twin.price_night1#>
    <cfset tprice = #tprice1#*0.90>
    <cfelseif form.twin gt "0" and form.nights gte "4" and form.nights lt "8">
    <cfset tprice1 = #form.nights#*#twin.price_night1#>
    <cfset tprice = #tprice1#*0.85>
    </cfif>
    <cfoutput>#tprice#</cfoutput>
    Any one any ideas.
    Thanks
    Jonathan Hemmings

    I have tried this:
    <cfoutput>#numberFormat(tprice,”-£____.__”)#</cfoutput>
    But i keep geting this error:
    The following information is meant for the website developer for debugging purposes.
    Error Occurred While Processing Request 
    Invalid construct: Either argument or name is missing. 
    When using named parameters to a function, each parameter must have a name.
    The CFML compiler was processing:
    An expression beginning with numberFormat, on line 269, column 57.This message is usually caused by a problem in the expressions structure.
    The body of a cfoutput tag beginning on line 269, column 47.
    The body of a cfoutput tag beginning on line 269, column 47.
    Am i using it wrong?
    Thanks
    Jonathan hemmings

  • Quantity column display upto 2 decimal places in ALV

    I've created an ALV for dynamic columns. For this i've first created the fieldcatalog and then the internal table.
    The problem that i'm facing in this is that the user wants the quantity column to be displayed upto 2 decimals. For this i tried the following:
    1.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '3'.
             wa_fldcat-datatype     = 'QUAN'.
    with this i tried that let the calculation be to 3 decimal places but on output it should show 2 decimal places.
    But this doesnot gets reflected on ALV. It still shows 3 decimal places.
    eg:  3 decimal places: 16.667 + 16.667 + 66.667 = 100.001
    2.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '2'.
             wa_fldcat-datatype     = 'CURR'.
    I also tried doing the calculation with 2 decimal places with datatype CURR but with this the last digit gets rounded.
    eg:  2 decimal places:  16.67  + 16.67   + 66.67   = 100.01
    Now we are taking total as 100 %. So tha calculative total cannot be more than 100.
    On seeing 100.001 user says show it to me to 2 decimal places  i.e. 100.00
    On seeing 100.01 user says  how can the total be more than 100 & this is .01 more than 100.
    Therefore how can the 1.) option be achieved.
    PLZ HELP!

    Hi,
    Can u check this one
    DATA: gv_packed TYPE p DECIMALS 2.
    CATCH SYSTEM-EXCEPTIONS conversion_errors = 6.
    MOVE char_field TO gv_packed.
    ENDCATCH.
    IF sy-subrc = 6.
    error handling
    ENDIF
    Try to move ur char field to a type p field. If char field is other than numeric then u will get error that can be handled in try...chatch..endtry block.
    data: l_val type p decimals 2.
    parameter my_val type char20.
    try .
    l_val = my_val.
    catch cx_root.
    Do ur error handling here
    endtry.
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
    concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Thanks.
    Ashok.

  • Printing ALV output

    Hi All,
    Thanks in advance.
    I have requirement to have a checkbox on the selection screen to print.
    If the check box is checked the report has to print the ALV output with page number 
    on the printer given on the selection screen .
    Can anyone please suggest me how this can be done.
    Thnanks,
    Gayatri Hemnur
    Moderator message: please research yourself first, look for available information and solutions.
    Edited by: Thomas Zloch on Dec 15, 2010 3:29 PM

    Hi,
    I think you are talking about line-size.
    ... LINE-SIZE col
    Effect
    Creates a report with col columns per line.
    If the LINE-SIZE specification is missing, the line length corresponds to the current screen width. The system field SY-LINSZ contains the current line size for generating lists. The maximum width of a list is 1023 characters. You should keep lists to the minimum possible size to improve useability and performance (recommendation: LINE-SIZE < 132). For very wide lists (LINE-SIZE > 255), you should consult the notes for using LINE-SIZE
    greater than 255.
    Notes
    The specified LINE-SIZE must not appear in quotation marks.
    If the you want the report list (i.e. the output) to be printable, do not define a LINE-SIZE with a value greater than 132 because most printers cannot handle wider lists. You cannot print lists wider than 255 characters at all using the standard print functions. To print the contents of the lists, you need to write a special print routine that arranges the data in shorter lines (for example, using the PRINT ON addition in the NEW-PAGE statement.
    At the beginning of a new list level, you can set a fixed line width for the level using the ... LINE SIZE addition to the NEW-PAGE statement.
    Example
    REPORT ZREPNAME LINE-SIZE 132.
    Kindly reward points by clicking the star on the left of reply,if it is useful.

  • Formatting Numeric Only with Variable Decimal Places

    Acrobat Pro 9, Windows XP
    I'm creating a form that has a number of text box form fields that are to be numeric only per the form requestor. However, for any given field of this type the number of decimal places that can be entered can vary from 0-3 and the requestor does NOT want any unnecessary decimals to appear in the final output (e.g., a "1.2" entry should not appear as "1.200"). The standard number formatting properties always show all the decimal places so I know it's not that route. No calculations will be performed with any of these entries -- the form requestor merely is entering data and then printing it out so that it's legible for the end-user.
    I know that the following line of JavaScript in the Custom Keystroke property limits the entry to numeric only, but how should I tweak the syntax to allow a decimal entry:
         event.rc = (!event.change || /^\d$/.test(event.change))
    I probably also need a script to format for decimal places, but I don't know where to look in the JavaScript for Acrobat API Reference or in the MDN JavaScript Reference.
    Thanks in advance for any assistance.

    Good question. To keep it simple (because there are about 300 form fields in this document), if they choose to add extra decimal zeros, then who am I to argue with their entry. So in your example for a given form field, if they enter "1.200" then I expect that they want "1.200" to display.
    OK, but earlier you said:
    "However, for any given field of this type the number of decimal places that can be entered can vary from 0-3 and the requestor does NOT want any unnecessary decimals to appear in the final output (e.g., a "1.2" entry should not appear as "1.200")."
    This seems inconsistent. Can you clarify? The point is the code and where it's placed depends on this. It could be implemented either as a custom Validate or Format script, in addition to a Keystroke script.

  • How to take float precision to two decimal places?

    Hi, everybody:
    I'm a straight noob...first week in Java programming. Before you bash me for not checking FAQs and such, believe me, I have.
    I have tried BigDecimal movePointLeft, but I don't know how to construct it using proper syntax. I also tried currency and toString but I keep messing up my syntax somehow. Four hours into this and nothing is working.
    Here is the problem: I have a float. I want to format its output to two decimal places, trying to achieve in Java what C would produce as:
    printf("The amount you owe is $%.2f", fltAnyName);
    Any help would be appreciated.
    Thanks,
    Rob

    Sorry, guys. I have tried both recommendations and I can't get either to work. I'm getting a compile error pointing to the delineating period between the "out" and "printf" when I try the C-like code. I have 1.5, too. I know your advice is sound so I must be doing something wrong. Can you insert the code DecimalFormat code that will correct this problem where it needs to go? The packages below have been included becasue of all the different solutions I have attempted.
    import java.io.*;
    import java.math.*;
    import java.text.*;
    import java.lang.*;
    public class CoinCalculator2
         public static void main(String[] args) throws IOException
              String strQuartes, strDimes, strNickels, strPennies;
              int intQuartes, intDimes, intNickels, intPennies;
              float fltValue;
              BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
              System.out.println("THE COIN CALCULATOR");
              System.out.println();
              System.out.print("Enter the number of quarters you have: ");
                   strQuartes = dataIn.readLine();
                   intQuartes = Integer.parseInt(strQuartes) * 25;
              System.out.print("Enter the number of dimes you have: ");
                   strDimes = dataIn.readLine();
                   intDimes = Integer.parseInt(strDimes) * 10;
              System.out.print("Enter the number of nickles you have: ");
                   strNickels = dataIn.readLine();
                   intNickels = Integer.parseInt(strNickels) * 5;
              System.out.print("Enter the number of pennies you have: ");
                   strPennies = dataIn.readLine();
                   intPennies = Integer.parseInt(strPennies);
              fltValue = (intQuartes + intDimes + intNickels + intPennies) / 100;
              System.out.println();
              System.out.println("The value of your coins is $" + fltValue);
              System.out.println();
    }

  • ToGB() decimal places

    Hi All,
    I have this piece of code which outputs the values to a html file.
    (get-mailboxdatabase)|foreach-object {
     $database= $_.name
     $accounts= (get-mailbox -database $_.name).count
     $size = (get-mailboxdatabase $_.name -status).databasesize.ToMB()/1024
         add-content $wfile "<tr>"
         add-content $wfile "<td align= 'center'>$database</td>"
         add-content $wfile "<td align= 'center'>$Accounts</td>"
         add-content $wfile "<td align= 'center'>$size</td>"   
    My issue I can't get the size to output to 2 decimal places it outputs 8 decimal places.
    If I use ToGB() instead of ToMB()/1024 I only get the whole number
    I have tried using {N0:02} but it doesn't help
    What am I doing wrong?
    TIA
    Andy

    How are you applying the format string?
    $size = '{0:N2}' -f ((get-mailboxdatabase $_.name -status).databasesize.ToMB()/1024)
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Displaying 3 decimal places?

    Hi,
    I have a bespoke program which picks up lines from bsis and displays them on a screen, the user then selects a few lines and the program posts them using program RFBIBL00. 
    Currently this program is working perfectly but I have a few countries which work with 3 decimal places instead of 2 and the program isn't picking this up.
    I've found that table TCURX holds currencies which have 3 decimal places but I want to know how I change all my internal tables and screen fields to suddenly have 3 decimal places instead of 2?  My internal tables and screen fields are all based on fields from BSIS and I have ALV grids and individual screen fields.  Do I need to duplicate all of the amount fields, one set to have 2 decimal places and the other to have 3?
    Any suggestions welcome.
    Gill

    OK, I've figured this out.
    If you define your screen fields (on the screen not in your data declarations) as CURR not DEC as mine were then you can put in a field as a reference.  I defined a new field (not a screen one) which held the currency for the screen.  If I define all my currency amount fields with 3 decimal places but refer them all to the currency field then they appear as 2 or 3 decimals places depending on the currency.
    Thanks for all your suggestions, they got me thinking on the right track.

  • Decimal Places in Item Cost must be 6 characters while in Journal Entry 2.

    I have the following problem:
    Accounting needs to see and work with 2 decimal places, but the item cost is needed in 6 decimals.
    If I register a A/P Invoice and i go to the Journal Remark, the Journal Entry should be in 2 decimals. If i look for the Item Cost on the Wharehouse this cost should be in 6 decimals.
    Is there a way to handle Accounting in 2 units and Cost in 6 Units
    Thank You very much

    Hi Saul,
    The request appears illogical, how can the accountant work with 2 decimal places & the item valuation is held with 6? The stock account with 2 decimals will never match the stock audit report with 6 decimals.
    I'm afraid the SAP Business One core functionality does not cater for this need. There are no 'behind the scenes' journal entries. A JE is legally binding so you need to decide whether you wish to work with the most accurate calculations regarding item cost as possible (6 decimals) or accommodate the accountants & work with 2 decimals in the journals.
    You might want to take the nature of the stock into consideration, if there are huge quantities at small individual prices 6 decimals might be better, if you use mainly standard cost &/or have no major cost fluctuations when using MAP/FIFO, 2 decimals might be sufficient.
    All the best,
    Kerstin

Maybe you are looking for

  • Safari won't open to 'all windows from last session'

    Safari is set to open to 'all windows from last session' - but it opens to a blank page.  Not every time, but 75%+.  I usually have multiple tabs open, not always the same ones, and this is slow, annoying and tedious to frequently reconstruct where I

  • File-name not being fetched in a multi-message mapping by Dynamic Conf

    In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration..... the prob

  • Ipod classic won't turn on and it just has a blank screen

    My 120GB ipod classic worked fine the other day but when I went to use it today the screen is completely blank and won't turn on. I plugged it in to charge it and the screen was still just blank. I plugged it into my computer and neither itunes or my

  • Change over to oracle

    The name of this question is chane over Hello and Thank you in advance for any assistance. System info: presently using Netbeans 6.7,MySQL,glassfish The Purpose of this post is: to change over to oracle ,jdeveloper,glassfish The functionality of this

  • Printing Linked List in reverse

    Hi Im trying to print a linked list in reverse order.. ive tried to put the objects into an array stack and then start printing form the top of the stack. any ideas?