Rounding Off to lower value!

Dear Experts,
Currently am calculating some values, and it returns me the results as such:
If the calculated value is 6.85714, then by default the output value in my integer type variable is 7.
Now, whenever the output results in 6.xxx, even if it is 6.9999 then i want it to round off to 6.
How is it possible?
Please advice!
Regards,
Sundar.

Hi
Handle it like this,,,
CLEAR : l_f_kbetr4 , l_f_kbetr5 .
l_f_kbetr4 =   l_F_kbetr1 - l_f_kbetr3 .
CHECK      =   FRAC( l_f_kbetr4 ) .
IF CHECK GE '0.50' .
  l_f_kbetr4  = CEIL( l_f_kbetr4 ) .
ELSE .
  l_f_kbetr4  = FLOOR( l_f_kbetr4 ) .
ENDIF.
l_f_kbetr5        =   l_f_kbetr4 .
Hope it helps.
Praveen

Similar Messages

  • Rounding off net weight value.

    Hi experts,
    I want to round off the quantity value to the next integer value.
    I am using the FM 'J_1I6_ROUND_TO_NEAREST_AMT' as follows...
    call function 'J_1I6_ROUND_TO_NEAREST_AMT'
    exporting
       i_amount = gross_weight
       i_amount1 = net_weight
    importing
       e_amount = gross_weight
       e_amount1 = net_weight.
    i want to round off the gross weight and net weight values.
    In Global definitions, these are given as of type VEKP-BRGEW. The field BRGEW is of datatype QUAN (length - 15 and decimal -3 )
    But when i tried executing i am getting dump .... saying
    "The function module interface allows you to specify only
    fields of a particular type under "I_AMOUNT".
    The field "GROSS_WEIGHT" specified here is a different field type"
    Please help me solve this and please let me know how to round off these fields.
    Regards
    Ammu

    Hi,
    the both fm parameters you fill have a currency data element of length 13, while you pass a quantity data element of length 15.
    You can't use this fm for your fields.
    Regards,
    Klaus

  • Problem in Routine after rounding off the condition value

    Dear all,
          I have attached the routine for rounding off value for condition value for T.Code va02. Routine is working fine but the problem is after the execution of routine it goes in some standard program LV61AA55 where again the rounded value gets changed . Maximum points will be allocated ..
    Thanks anr Regards

    FORM FRM_KONDI_WERT_925.
    *{   INSERT         D01K911062                                        2
    data : wa_xkomv like xkomv,
            v_kwert like xkomv-kwert,
           W_INDEX  TYPE SY-TABIX.
    read table xkomv into wa_xkomv with key kschl = 'JIN6'.
    W_INDEX = SY-TABIX.
    v_kwert = 1 * wa_xkomv-kwert / 100.
      V_KWERT = WA_XKOMV-KWERT.
    read table xkomv with key kschl = 'JHSC'.
    CALL FUNCTION 'J_1I6_ROUND_TO_NEAREST_AMT'
       EXPORTING
         I_AMOUNT                 = v_kwert
       I_AMOUNT1                =
       I_AMOUNT2                =
       I_AMOUNT3                =
       I_AMOUNT4                =
       I_AMOUNT5                =
       I_EXADDTAX1_AMOUNT       =
       I_EXADDTAX2_AMOUNT       =
       I_EXADDTAX3_AMOUNT       =
      IMPORTING
        E_AMOUNT                 = v_kwert
       E_AMOUNT1                =
       E_AMOUNT2                =
       E_AMOUNT3                =
       E_AMOUNT4                =
       E_AMOUNT5                =
       E_EXADDTAX1_AMOUNT       =
       E_EXADDTAX2_AMOUNT       =
       E_EXADDTAX3_AMOUNT       =
    xkomv-kwert = v_kwert.
    xkwert = v_kwert.
    modify xkomv INDEX W_INDEX transporting kwert.
    *}   INSERT
    ENDFORM.

  • How to avoid rounding off large Double values?

    For converting from String to Double, consider a piece of code as below:
    String str = "999999999999999.99999";
    Double d = Double.valueOf( str );In this case, d will contain the value 1E15 and not 999999999999999.99999.
    Is there any way by which we can avoid this rounding off?
    TIA,
    Ninad.

    > String str = "999999999999999.99999";Note that you have a total of 20 decimal digits here.
    A double only has 53 bits to represent the mantissa
    so it can only accurately represent about 16 decimal digits.

  • Rounding off Issue (Net Value not equal to Net Price * quantity)

    Dear Gurus,
    Here is an interesting issue.The default calculation done in the pricing procedure is two decimal places.Now we consider a real scneario,consider the net value of 324 quantities of an item calculated is 36,049.86 .When it is divided by quantity  the resulting value of net price is 111.265 but the system shows 111.27 by rounding it off.
    Now here comes the problem,my client needs the rate to be shown on the order script to be two decimal places and the net value should be equal  quantity * net price.So if we apply this,
    324 * 111.27 = 36051.48
    But the net value calculated by the system is 36,049.86.So it can be consluded that:
    "Quantity * Net Price Shown is not Equal to Net Value calculated by the System"
    Need an urgent resolution,project is stuck on this
    Regards,
    Sam Ahmed
    Edited by: Lakshmipathi on Nov 3, 2011 12:14 PM
    Please dont add URGENT in subject or in your post

    Here is the pricing procedure,
    We start with the amount condition types
                                            Unit Price        Units Condition Value
    ZMRP     MRP                     1,700.00           10     PAC     55,080.00      
    ZTRP     Trade Price     1,445.00           10     PAC     46,818.00      
    ZDPR     Dist. Price     1,445.00           10     PAC     46,818.00         (GL)
    Using Trade Price we apply the product discount of 23%
    ZPRD     Product Discount     23.000-     %                    10,768.14-
    Then we send discount amount to the gl by using condition type ZDIS
    ZDIS      Discount Value     100.000-     %           10,768.14-      (GL)
    tHE RESULTING NET VALUE IS  36,049.86      as 46818.00 - 10,768.14
         Order Item value     111.27      1     PAC     36,049.86      
    And the Net Price is 111.27

  • Rounding off to nearest value with formatNumber

    Can I use the formatNumber tag to round my numeric value to the nearest value?
    Like if it's 15.7 I would like to display 16
    And if it's 15.2, I would like to display 15
    I could successfully truncate by giving a patteren but Im not sure if I can round it off.
    Regards,
    Leena

    Yes you can - the following works on JSTL 1.1 / Tomcat 5.5 :
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <html>
    <head><title></title></head>
    <body>
    Test Auto Rounding of 16.8 :
    <fmt:formatNumber value="16.88" pattern="##"/>
    <br/><br/>
    Test Auto Rounding of 16.2 :
    <fmt:formatNumber value="16.22" pattern="##"/>
    </body>
    </html>Message was edited by:
    appy77

  • Rounding off to a variable value to 4 decimal values in sap script ouput

    Hi All,
    I have a value getting displayed in sap script output as 235.6789 i want to Round off this variable value to 4 decimal values!
    What is the formatting option need to be used & how!
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    1.In layout just call that variable, where you need like:
    &variable(.4)&.
    Just see these:
    &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
    Regards,
    If helpful reward with points(Don't forget).

  • Sales Order Net Value - Round off

    Hi Guru's,
    I am having a requirement to round off the total value (VBAK - NETWR) in sales order.
    Condition type DIFF is not fulfilling our requirement because its functioning as an item condition. It's doing round off for each line item.
    Our requirement is Header level net value round off.
    I have searched in SCN but I cant able to find any solution. Kindly throw some light on this subject.
    Regards,
    Dinesh

    Hi,
    After downloaded the note 1158475 implementation status show that cannot be implemented.
    Check the screenshot below.
    Regards,
    Dinesh

  • User exit for rounding off result value

    Hi Gurus,
    Is there any user exit available or std. functionality by which we can round off the result value. My client wants if the value is 192.5 or 191.8 then this value should be rounded off to 195. That means rounding in multiples 0f 5. Is there any exit available?
    Regards
    Amit

    If in QM just specify the correct number of decimals for the characteristic, in your case 0. In config under plant settings you can set up the results recording settings to allow you to record one additional decimal then specified by the characteristic. The result is rounded to 0 decimals when displayed.
    FYI - there should be no reason to have to use user exits to round off decimals in QM.
    Craig
    I didn't read the initial posting correctly.  To round the whole number portion by 5 you will have to provide that logic yourself via the user exits already posted.
    Craig
    Edited by: Craig Snyder on Jan 13, 2010 2:56 PM

  • Rounding off currency value

    Hi all,
           Is there a function module to round off the currency value to nearest 0.05 , ie. if the currency value is 10.63, it should be rounded off to 10.65 and when it is 10.68, it should be rounded off to 10.70?
          If yes, could you please let me know?
          Any help in this regard is appreciated.
    Regards,
    Partha.

    hi,
    try this out.here is the sample program.
    pl look into my modified program,
    i am assuming your requirement is like
    if the last digit in your value is < 5. it should be rounded to 5.
      like 10.23 should come to 10.25
    & if the last character value is > 5 , it should be rounded to next value with 0.
        10.67 should be 10.70
        10.98 should be 11.00.
    with this assumption, i developed this small code. let me know, if i am wrong.
    regards
    srikanth
    DATA : V_CURR TYPE VBAK-NETWR,
           V_CHAR(10) TYPE C.
    V_CURR = '10.67'.
    WRITE  V_CURR TO V_CHAR.
    CONDENSE V_CHAR NO-GAPS.
    DATA : V_STRLEN TYPE I.
    BREAK-POINT.
    V_STRLEN = STRLEN( V_CHAR ).
    IF V_STRLEN <> 0 .
      V_STRLEN = V_STRLEN - 1.
      IF V_CHAR+V_STRLEN < '5'.
        V_CHAR+V_STRLEN = '5'.
        V_CURR = V_CHAR.
      ELSE.
        IF V_CHAR+V_STRLEN = '6'.
          V_CURR = V_CURR + '0.04'.
        ELSEIF V_CHAR+V_STRLEN = '7'.
          V_CURR = V_CURR + '0.03'.
        ELSEIF V_CHAR+V_STRLEN = '8'.
          V_CURR = V_CURR + '0.02'.
        ELSEIF V_CHAR+V_STRLEN = '9'.
          V_CURR = V_CURR + '0.01'.
        ENDIF.
      ENDIF.
    ENDIF.
    write :/ v_curr,
             v_char.
    added modified code.
    Message was edited by: Srikanth Kidambi

  • How to round off quantity in inventory

    Hi,
    How to avoid decimal places for PC(Piece) in the goods movement transactions..  I have given 0 decimal places in CUNI transaction. It is working properly for Production Order during Conrimation but it is not working in Inventory transactions like MIGO, MB1C,MB1A....
    for example When I enter Unint of entry In Alternate Unit say '10 KG'  System Automatically Caliculates quantity in base unit in decimal places say 115.012 PC based on the conversion factor defined in material master.
    My requiremet is the base unit quantity PC rounded off to nearest value in as 115 (PC).
    The same thing is working fine for production order.
    please suggest me how to do.
    Thanks,
    Shekar

    this all depends on your conversion rate enterd in material master.
    if 115.012 PC  equals 10 KG.
    what do you actually want the system to do,
    it would now that you would get 115.012
    you want it to be 115,
    this would then mean that you have to modify the entered quantity from 10 to 9something
    Is it that what oyu want?
    you certainly cannot have 115 PC and 10 KG if you dont change the conversion rate in your material master

  • Rounding-off difference in Line Item vs Invoice

    Can anyone help on how to correct the rounding-off difference in the amount per line item display vs the amount printed in the invoice?  In viewing the document, the line item has an amount of 187.09, meanwhile, when invoice was printed, the amount was 187.10.

    Hi
    Ask ABAPer to modify the format for the invoice amont number field not to round off to nearest value in invoice form.
    Regards
    Laxmiprasad

  • Condition type for rounding-off

    Dear all,
    Is there any pricing condition for rounding off the PO values,
    For example if the total PO Value is comes Rs 5990/- & i want to make it Rs 6000/-.In the same way i want to deduct some amount to make the rounding off like total PO Value comes as Rs 10015/-, & i want to make it Rs 10000/- by applying the same condition.
    Or Can i create a new condition type for this type of scenerios.
    Quick reply will be highly appreciated.
    Thanks & Regards
    Prasant sekhar

    in condition type u have a filed for rounding off
    so use the relveant option from f4 help in that field and u can round of the value as u want to be
    go to tcode m/06
    and select ur conditoin type and click on the detail button and do the relevant settings

  • PO Quantity Rounding Off

    Hi All
               In the output of purchase order i have to avoid rounding-off of quantity value.Its coming in my output by default. Please help me.
    Regards Biju

    what was the solution you came up with?

  • User exit for rounding off

    Hi Gurus,
    Is there any user exit available or std. functionality by which we can round off the result value. My client wants if the value is 192.5 or 191.8 then this value should be rounded off to 195. That means rounding in multiples 0f 5. Is there any exit available?
    Regards
    Amit

    closing thread
    Regards
    Amit

Maybe you are looking for

  • Problems Downloading Adobe Creative Cloud

    Hey, so I recently cleaned my computed and I apparently got rid of Creative Cloud when cleaning. When I was about to download this showed up, then, it began to install but closed down, nothing happened! Does anyone know how to fix this problem?

  • Post Capitalization in asset master creation

    Hi sapers what is use of the post capuitalization field in asset master creation if any one know pls explain with exampls Thanks in Advanse Ram

  • Itunes error: network connection timed out

    Every time I try and log into my Itunes account I get an error message saying We could not complete your Itunes Store request. The network connection has timed out. How can I fix it? Edit: My virus scanner is Avg and I use ad-aware 2007 for spyware.

  • Printing a wide margin word document to .pdf

    I need to convert an MS Word document to a .pdf file. The doc has a number of columns and it is not practical to shrink it to a standard margin size doc. Will Adobe Acrobat convert this to a .pdf (I guess one that has a "slider" at the bottom)? Thank

  • Can I Partition to run 10.8 and 10.6?

    I have a new iMac with M. Lion 10.8.2 which with will not run a few of my older applications.  Is it possible to partition my 1tb hard drive to run 10.8 and 10.6?  If so, how would it be done?