Decimals upto 4

Hi all
    I have to save a decimal number in the database upto 4 decimal places.But when I gave datatype DEC for the domain and length 16 , 4-decimal places it is only saving upto 2 decimal places(I can see on screen).I also gave output length as 21 including sign.Please help me.
Thank You.
Regards
Giri

hi Giri,
either search for a data element with 4 decimals or create your own data element with 4 decimals.
ec

Similar Messages

  • Decimals upto 2 in alv report

    Hi to all abapers,
    I have to show only upto 2 decimals in the field of an alv report but it is of type p and decimals 4.I dont want to change its type to 2 decimals due to some calculations.So can we show upto 2 decimals in the report?
    Thanks in Advance,
    Salish

    Hi,
    Here is the code
    <b>Here act_pckeff is of type p decimals 4 and i want it upto 2 decimals in the output.</b>
    PERFORM fldcat  USING i_fieldcat 'ACT_PCKEFF'       'DEC'       'Actual Efficiency "Packed"'    ''."13
    FORM fldcat USING p_ifieldcat TYPE lvc_t_fcat
                          value(p_name)
                          value(p_type)
                          value(p_desc)
                          value(p_key).
      DATA: w_fldcat TYPE LINE OF lvc_t_fcat.
      CLEAR w_fldcat.
      w_fldcat-fieldname = p_name.
      w_fldcat-datatype = p_type.
      w_fldcat-reptext = p_desc.
      w_fldcat-key     = p_key.
      IF w_fldcat-fieldname = 'AUFNR'.
        w_fldcat-no_zero = 'X'.
      ENDIF.
      IF p_type = 'CURR' OR p_type = 'QUAN'..
        w_fldcat-do_sum = 'X'.
      ENDIF.
      <b>IF p_name = 'ACT_PCKEFF'.
        w_fldcat-decimals = 2.
        w_fldcat-do_sum = 'C'.
      ENDIF</b>.
      APPEND w_fldcat TO p_ifieldcat.
    ENDFORM.                    " fldcat
    Regards,
    Salish.

  • How to increase  decimals upto four for dollars as well as for rupees

    Hi,
    As per the client requirement,we need to give four decimals for price, for example $24.3456 per Kg, Rs.71.2345 per Kg. We would like to know how to proceed & what would be the  relevant impact it would have on other areas.
    regards
    Devi Vellanki

    Hi,
    If you wish to change the decimals only for pricing or in SD, then you should refer to SAP Note 38881(Pricing with different decimal places). This Note explains in detail how to proceed.
    Regards
    Nikhilesh
    Edited by: Nikhilesh shenoy on Apr 21, 2008 6:14 PM

  • Decimals upto length 2

    Hello All,
    In my ALV display, there is one fields value getting displayed in decimals as:
    suppose 1.167, I want the output as 1.16 only and not the round of value that is 1.17.
    Kindly help.
    Mansi

    Hi,
    For this you need to implement sompe logic, check the below code might be helpful
    data: v_data1 type p decimals 3 value '1.167',
          v_data2 type p decimals 2,
          v_char1 type char20,
          v_char2 type char20,
          v_char3 type char3,
          v_char4 type char20.
    write v_data1 to v_char1.
    split v_char1 at '.' into v_char2 v_char3.
    concatenate v_char2 '.' v_char3+0(2) into v_char4.
    move v_char4 to v_data2.
    write:/ v_data1, v_data2.
    Regards,
    Anil

  • No rounding decimals

    Hi,
    i am using currency(ZCURR) field.
    which is upto 2 decimals.
    after calculation in currency(ZCURR) field data is comming wotih rounding.
    also i tried with PACKED decimals upto 2
    still it rounding off as i wnat actual value upto 2 decimals
    Ex: ZCURR type VABAK-netwr.
    ZCURR = '2331.437'.
    write : ZCURR
    result : 2331.44  but i want at output "2331.43".
    please help.

    Hi,
    Try below
    SPRO->Sap customizing guide->sap netweaver->general setting->currencies->set decimal places for currencies
    Surendra Jain

  • Problem caluclating the average

    Hi,
    The requirement is as follows:
    Col A | Col B
    1 | 4.1
    1 | 3.2
    1 | 1.1
    1 | 2.3
    1 | 1.5
    2 | .3
    2 | 6
    3 | 0.2
    3 | 8
    3 | 3.1
    and so on....
    I need Column C that calculates the average of each group of Column A (Ex:- (4.1+3.2+1.1+2.3+1.5)/count(1's in col A)), (0.3+6)/count(2's in col A), etc. and I was able to achieve that creating a new column in the report and writing in it the below formula as below:
    sum("Col B")/count("Col A")
    The result was as follows which is correct:
    Col A | Col C
    1 | 2.46
    2 | 3.15
    Now my next task is to find the average of the above like sum(Col C)/count(Col A). I tried to calculate the same using the below formula
    sum(sum("Col B")/count("Col A"))/count("Col A")
    but the average is somehow not being calculated correctly when i try to validate using manual calculation. I changed the column properties to decimals upto 4 places, I even tried with 8 places of decimal, but still the answer is not correct. What am I doing wrong, is the above formula correct?
    Appreciate your quick response and help. Thanks!!!!!

    Pankaj wrote:
    Hi,
    The requirement is as follows:
    Col A | Col B
    1 | 4.1
    1 | 3.2
    1 | 1.1
    1 | 2.3
    1 | 1.5
    2 | .3
    2 | 6
    3 | 0.2
    3 | 8
    3 | 3.1
    and so on....
    I need Column C that calculates the average of each group of Column A (Ex:- (4.1+3.2+1.1+2.3+1.5)/count(1's in col A)), (0.3+6)/count(2's in col A), etc. and I was able to achieve that creating a new column in the report and writing in it the below formula as below:
    sum("Col B")/count("Col A")
    The result was as follows which is correct:
    Col A | Col C
    1 | 2.46
    2 | 3.15
    Now my next task is to find the average of the above like sum(Col C)/count(Col A). I tried to calculate the same using the below formula
    sum(sum("Col B")/count("Col A"))/count("Col A")
    but the average is somehow not being calculated correctly when i try to validate using manual calculation. I changed the column properties to decimals upto 4 places, I even tried with 8 places of decimal, but still the answer is not correct. What am I doing wrong, is the above formula correct?
    Appreciate your quick response and help. Thanks!!!!!First of all, using your figures as actual examples, the average for 1 is not 2.46, but 2.44.
    To get what you are looking for, do this:
    1) To get the average of each group in Col A, use this formula in a column called "Average":
    AVG(Col B BY Col B)
    Use a pivot table and put Col A in the Rows Section and the Average column in the Measures Section. Don't put any other columns in this pivot table or you will get unexpected slicing and dicing of the data.
    2) To get the average of the averages, duplicate the pivot table to get Pivot Table:2 and put the "Average" column in the Measures Section. Exclude all other columns. (In other words, take out column A from the Rows Section. You will get the average of the averages.

  • VOFM  rounding issue need to perform calculations till only 2 decimals

    Hello  All,
    In Sales order the price calculations are  being performed till 4 decimal places but we want to restrict till 2 decimal only .  Providing example
    Suppose Price  is  2 USD .   Add 4.6%  for adjustment ,  this will become  2.092  ( for qty 1 ).   Now  in column Amount in condition tab of sales Order I can see value as 2.09  .  
    The Quantiy for an Sales order item is 10 .  SAP multiples 2.092  with 10  and we get 20.92 .   
    If we use value 2.09  and multiple it by 10 we will get 20.90 .     Here we can see difference in amount  by 2 cents. 
    We need to restrict calculation upto 2 decimals ( 2.09 )  and  this shld be multiplied with 10 .   Please  guide me in detail on routine if any which we can use for this , how to write logic in this routine , do we need to use Exit ? .
    Thanks a lot .
    Sujit .

    Hi Sujit,
    use  WRITE A TO B 2 DECIMALS.
    Thanks,
    Naresh.

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

  • Condition type value to have upto 7 decimal points

    Dear All,
    We are calculating yield. The client wants us to take the value upto the 7 decimal points. Can somebody help me how we can achieve this. If this is a development how can we have this.
    Regards
    Chakradhar

    Hello Paturi,
    First you have to maintain the number of decimal places for the required currency.
    This can be done in spro--> general settings --> currencies --> set decimal places for currencies.
    Then the condition value comes automatically in the specified number of decimals.
    Hope this info helps you.
    regards,
    Bhanu.

  • Smartforms Currency decimals 3

    Hi,
    I have a problem with the element KBETR, in vf03 i have 1,769- %.
    In the table KONV, the field kbetr have 17,69-.
    How can i convert the field in percentage please?
    Do you know a data element with currency and decimals 3? when i divide by 10 i have 1,77- and not 1,769-.
    I repeat that im work with smartforms.
    They are not an other solution that create a data element?
    Thanks.
    Edited by: Spawn rad on Jul 21, 2008 5:36 PM
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 21, 2008 12:19 PM

    try this
    &symbol(.N)& Display upto N decimal places.
    other options:
    &symbol(Z)& Omit Leading Zeros
    &symbol(S)& Omit Leading Sign
    &symbol(<)& Display Leading Sign to the Left
    &symbol(>)& Display Leading Sign to the Right
    &symbol(C)& Compress Spaces
    &symbol(.N)& Display upto N decimal places
    &symbol(T)& Omit thousands separator
    &symbol(R)& Right justified
    &symbol(I)& Suppress output of the initial value
    u can use various combinations of these options.
    Example:
    &SFSY-FORMPAGES(3ZC)&---outputlen,c-condense,z-
    Reward if helpful

  • Price upto four decimal places

    Hi ,
    I am using Basic planning objects for estimation of project.
    I havea item whose price is to be calculated on percentage basis.For Example Price o item X is 0.25% of Value Y.But when I am putting rate of that item as 0.0025 ( INR )system doesnt excepts this is also same for quantity.Since the decimals are restricted upto 2 for Price & upto 3 for Quantity.
    How this can be solved ?
    Rgds

    Hi Shrikant
    I made the settings & tried to put in the Quantity field of ECP but following error is shown by system.
    Too many decimal places (maximum 3)
    Message no. DB739
    Diagnosis
    You specified 4 decimal places, but the field allows only 3 decimal places.
    System Response
    Unable to continue processing.
    Procedure
    Correct your input.
    Rgds

  • Difference becuse of decimals in MIRO

    Dear all,
    one of my client is facing issue because of  2 decimal point.
    e.g.As against one PO we had asked for 3000 qty of material at rate mentioned in PO 7.31as per this cost comes to R's 21930/-where as the party invoice shows R's 21937.50 , where as the difference of R's 7.50
    this difference has comes due to the 2 digit decimal point, if we take the decimal point upto 4 digit the cost will come exact as per the amount payable.ie the price if we take the cost as R's 7.1325 multiply by 3000 comes to RS.21937.50
    please help to solve this issue,
    our finance department needs 2 decimal point only,if we make to 4 decimal is any adverse effects.
    thanks&regards
    Syed

    hi syed
    Changing the decimals of a currency from 2 decimals to 4 decimals is not advisable. if you do that there would  be inconsistencies with the values all ready posted as the changes to the decimals are done at the global level. and changing the decimals in the production system is not advisable.
    the work around could be increse the base quantity of the materials to 100... instead of each. ex your rate would be  123.4 for 100 pieces intstead of  1.234 for 1  piece
    assign points if found use full
    regards
    gkk

  • SD Pricining Condition Up to 7 Decimals Places

    Hi All,
    I want to maintain condition record up to 7 decimal places. In normal scenario we can maintain up to 2 decimal places and can be customized upto 5 decimals . How I can achieve this requirement ?
    Please help me .......
    Thanks & Regards
    N. N. Tiwari

    The simple work around is that in VK11, you maintain the price per ten thousand. 
    Let us assume, the selling price of Material A is 5.123456, your VK11 screen should be
    Material A::::::::::51234.56::::INR::::10000::::PC
    thanks
    G. Lakshmipathi

  • Value upto n dacimal places

    Hi Gurus,
    Plz consider follwoing.
    There are two field
    1. plmk-toleranzob  it has some floating value.
    2. plmk-stellen.   it has ineger value.
    I have to pick value from field <b>plmk-toleranzob</b>  upto decimal places equal to value of  <b>plmk-stellen</b>.
    How can we do it.
    points will be rewarded.
    regards
    Rajesh

    DATA: X TYPE P DECIMALS 2 VALUE '12493.97'.
    WRITE: /X ROUND -2,   "output: 1,249,397.00
           /X ROUND  0,   "output:    12,493.97
           /X ROUND  2,   "output:       124.94
           /X ROUND  5,   "output:         0.12

  • Upto 4 decimal value?

    Hi,
    I am getting value up to 6 decimals from database like this 123.234566.I want to display upto 4 decimal of this value like 123.2345. I have used format method of NumberFormat class as below:
    format( obj.getBigDecimal("colName").doubleValue())
    But using this way,I am getting values upto 2 decimals only as I am using this doubleValue method.Is there any other method instead of this one which I can use with format to get upto 4 decimal value.
    Please reply ASAP, its urgent!
    Thanx in advance

    Is there any other method instead of this one which I can use with format to get upto 4 decimal value.The output depends primarily on how you create your NumberFormat. See the [url http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html]DecimalFormat documentation for the various formatting patterns you can specify.
    Please reply ASAP, its urgent!Please don't say that your problem is urgent. It only pisses people off.

Maybe you are looking for

  • Problem with font size, not showing up as expected.

    I've been wrestling with this for a few weeks now, but surely must be getting closer to having it resolved. It's just a problem with font size on just this one page. http://www.kgngroup.net/logos_and_packaging.html I want the body text to be 10px, bu

  • A Flash popup keeps hanging so I can't get rid of it

    Hi - I haven't been able to play Farmerama for several days (all my crops have turned to weeds) because of a little box that pops up in front of it: "Adobe Flash Player Settings."  It says it's stored 6k and wants to store unlimited.  In the past, I'

  • Configuring Beacons for sending alerts in OEM grid control

    We have a requirement where we need to configure the beacons to send email alerts when there is a service failure for the services that are monitored by Beacons. Please share if any one has link mentioning step by step way of configuring the same. Ed

  • After deployment getting error as below.

    MSS/ESS Deployment Exercise : After building a project I successfully carried out several deployments after modifying the code within the project set. On the fifth deployment we encountered the familiar error message 'did not accept login request as

  • Trouble with Adobe Application Manager

    I'm getting the above error whenever I try to update any adobe applications.  It claims I have more than one iteration of it open, but my dock claims I only am trying o open the one instance.  Help.  (I'm running cc on a windows 7 laptop.)