Ceil calculation is wrong

Hi
I am using below formula to calculate no of cases
        w_no_of_cases_temp = CEIL( vbdpr-fkimg *
                               (  marm-umren / marm-umrez ) ).
input value is
vbdpr-fkimg  = 204000
marm-umren  = 1
marm-umrez  = 6000
output is 35. But it should be 34.
i checke few cases. Output is correct. Above itme oly i am getting wrong output. Kindly help me

Hi,
how does CEIL work.... ?
   After the decimal even if there is a single digit without 0 then it adds 1 to the result....
now taking your scenario...
CEIL( 204000 * ( 1 / 6000 ) ).
firstly the inner braces are calculated but they are not ceiled because CEIL is to be applied for the final result according to the statement above....
now, 1 / 6000 is calculated and the output is 0.000166... goes on...  or you can say 1.666666667e-4
since floating point numbers supports till certain numbers so this number becomes
0.000167
now when you calculate 0.000167 * 204000
the result is 34.068
now if CEIL is applied to this result..... it converts the number 34.068 to 35
if you want to cross check you can also use this statement
CEIL(24 * ( 1 / 6 ) ).
this will result in the value 5 whereas it is 4.
So for this case you will have to modify your logic a bit for you not to get this inappropriate results....
instead of using CEIL or any others functions
declare an integer variable
This is how it works....
DATA w_int TYPE i.
w_int = w_no_of_cases_temp.
write w_int.
*this should resolve your issue......
Regards,
Siddarth
Regards,
Siddarth

Similar Messages

  • Ranch Billing, the excise condition type JMOD calculation is wrong

    Hi
    I wish to know that in case of Branch Billing, the excise condition type calculation is wrong!!
    I am surprised and unable to know how it could be?
    In billing document display (T.code VF03) , Out of 3 Line items, Basic Excise Duty of 2 line items/ Materials were wrongly calculated.
    i.e. In Item level Condition Overview---> the excise condition type JMOD --> details -->
    Amount                   10.000  %
    Cond.base value            79,077.85  INR
    Condition value             5,733.14  INR
                                                                                    Alt.calc.type   355
    Ideally, It must be 7907.85 INR instead of 5733.14 INR wrong value.
    Please help me to know the possible reason.
    Thanking you.
    PP

    Check the condtion value in condition type UTXJ . If the JMOD value is 10% of UTXJ then assessable value should have been maintained for the Material and Plant combination in J1ID. This is due to Routine 351 maintined in pricing procedure for the condition type UTXJ
    check and confirm
    Senthils

  • FI posting baseline calculation is wrong.

    HI expart.
    in userexit_fill_xkomk1how to imlplennt for sap note -112385 for baseline calculation is wrong.
    What i will do for baseline calulation is coming as creation date.
    Thanks
    Dhirendra.

    Hi,
    By any chance, did the user enter march date in FB08 screen ?
    Best Regards,
    Madhu

  • Debit memo excise duty calculation is wrong

    Hi,
    Basic excise duty is wrongly picked in to debit memo as explained below
    1) Depot sales order: creted for qty 1
       Basic excise duty 80
    2) delivery created:
    3)depot excise invoice creted: Adjusted depot stock aganist plant excise invoice 123 and basic excise duty is 100
    4) created depot invoice; CAPTURED BASIC EXCISE DUTY IS 100 which is correct (356 movement type assigned to basic ex duty in pricing procedure)
    Depot returns:
    1)returns sales order created with referance to depot invoice
       copied basic excise duty as 1000 (which is correct)
    2) cretaed credit memo request: Here basic excise duty is 80 wronly copied from depot sales order instead of 100
    Please provide the solution
    Regards,
    ramesh

    Dear Lakshimipathy,
    Thanks for your response
    The excise duty combination is same in both returns order and credit memo as mentioned below
    Variable key
    country
    plant
    control code
    valid from 2010/02/27   valid to 2010/02/27
    condition supplements
    Country         name                                amount        unit       delition  id
    JEXP     IN: A/R BED %     10.000      %     flaged 
    And in pricing procedur6e of the returns order is neccessay 356 alternative calculation type
    as i mentioned above valid date has been expired and marked for delition how system is determinng excise duty for retuns order. please suggest
    Best regards,
    ramesh

  • Formula calculation showing wrong data.

    Hi All,
    I have an issue in the formula calculation at BEx.
    I have a formula2 whose values is formula1/RKF * Constant.
    formula2=formula1/RKF * Constant.
    Formula1    formual2        RKF             constant
    73.00          25.63            80.00         28
    The error is the actual value of  formula2 to be a
         formula2 = 73.00/80.00 * 28
                      =25.33
    But in report result it is displaying as 25.63.
    for some different values it is showing very different result.
    can any one tell me how to round of this value to avoid confusion
    regards,
    santosh.

    Santosh,
    rounding off the result will not solve your problem. In your scenario, the actual result is 25.33 and rounding it off will be 25.
    Now BI is showing you a value of 25.63 and rounding it off will give you 26. This will still give you the wrong answer.
    You can go to the properties for the formula and in the display properties, you can change it 0 decimal places instead of 2. This is just a interim solution.
    Regards,
    Sameer

  • Odd Calculator Issue - Wrong Answer??

    A friend of mine was working on something yesterday afternoon and used his original iphone calculator to check 197/14.......the calc returned 1. I tried the same on my 3g and it returned a 1 for me too. In fact we both tried several times during the afternoon with the same result.
    Today I checked again and it returned the correct answer..........14.0714286.
    Seems odd to have intermittent "wrong" answers and definitely makes me wary of trusting calculator for anything. Any ideas?

    Computers are usually deterministic, so the most likely reason is that you both made an entry error yesterday.

  • TS1702 The apple calculator calculates wrong on all iphone 5

    If you calculate .67 / .8 = 0.8375 this corrcet
    If you calculate .64 / .8 = 1 this is wrong, this must be 0.80
    All iphones I have checked does this
    Also if I download a calculator app, the app also does this?

    I get the same answer as the OP when I immediately start the second calc without clearing the first. What then happens is that you're dividing 0.64 by .80 = 0.8.  When you press = again it divides that answer by 0.8 from the first calc.
    Don't know why the OP doesn't just clear the first calc.

  • PF calculation  working wrong in RT table

    Hi
    Kindly check below calculation for PF in RT table.
    My question is /3F6 is 60000 (/3F5(5000)*12), but system is showing 59,000. Did I missed any config ????
      /3F1 Ee PF contribution        01  01   5,000.00
      /3F3 Er PF contribution        01  01    4,459.00
      /3F4 Er Pension contribution   01  01    541.00
      /3F5 Ee Mon PF contribution              5,000.00
      /3F6 Ee Ann PF contribution            59,000.00
      /3F9 PF adm chrgs * 1,00,000   01  01  45,833,700.00
      /3FA PF basis for Ee contrib   01  01     41,667.00
      /3FB PF Basis for Er Contrib   01  01    41,667.00
      /3FC Pension Basis for Er cont 01  01   6,500.00
      /3FE Interest accrued on total               365.00
      /3FJ VPF basis for Ee contrib  01  01   41,667.00
    /432 Agg of Chapter VI                    59,000.00
    I think /432 is 6000(5000*12), why system is calculating 59000,
    did I missed any configuration ????????
    Please guide me ..
    Thanking you
    Regards
    Nandhini

    /3F6 calculation formula is as follows -
    /3F5 = /3F5 YTD (year till date it will come from last month CRT) + /3F5 current month + /3F5 current month * projection factor.
    Here YTD value is the one which is creating problem or rather you say because of it, it is coming less.
    Try checking /3F5  in CRT table of last months one by one, you will get the month where it had been reduced.

  • Net Pay calculation is wrong, allowance wage type is not getting added to net amount..

    Hi Dears,
    We are doing payroll configurations for one of our client in india, Regarding our requirement ,we jus tried in test system, we have written a pcr rule stating 01st feb 2015, new allowance need to paid to employees belonging to L&T1 pa and LT ESG.. Allowance will be percent based on gross pay..allowance percentage differs according to the ESG..
    Before writing the PCR, Allowance percentage has been maintained in T511K.. And have configured as payroll constant ZTST 1 should be calculated with a value 2%.
    i have created a new wage type 9021 allowance wage type and this wage type amount should be automatically generated in payslip based on the pcr i have written while running payroll for an employee.
    EARNINGS                                                       DEDUCTIONS
    l&t basic pay 9000             54838.71                    INCOME TAX
    l&t conveyance 9100            2741.94                   12394.00
    l&t hra           9200               4387.10
    l&t allownace 9021                1239.36
    TOTAL Gross amount          63,207.11              Take Home pay (net pay)  49,573.75
    But the actual net amount should be 50,813.11..Based on the allowance wagetype i have created which is automatically generting using the pcr i have written , is getting calculated in the gross amount..
    but not getting added in net amount .so please help me out guys on how to solve this issue???
    Regards,
    Surya Prabha

    Hi Remi,
    Thanks for your kind reply, yes these values are taken from the remuration statement of a  particular pernr whom am running the payroll..
    i have checked the processing classs and i have maintained 5 and 70 which add this new allowance amount to my net amount.  now the net amount is proper.
    EARNINGS                                                       DEDUCTIONS                   perks/other income/exemptions
    l&t basic pay 9000             54838.71                NCOME TAX                       l&t leave encashment    1239.36
    l&t conveyance 9100         2741.94                   12416.00
    l&t hra           9200               4387.10
    TOTAL Gross amount          61,967.75             Take Home pay (net pay)  50 791.11
      Regards,
    Surya Prabha

  • CST and VAT calculation is wrong for Tool amortisation PO

    Hi,
    We have tool amortization process in out company.
    Vendor develops tool for us and same will be amortized for each part paying addionally some amount other than material cost ( Condition type ZAMT).
    Excise duties to be calculated for tool cost also. But not VAT or CST.
    Now issue is  tool amortization cost is calculated for excise duties ( Base price and ZAMT price ) which is correct.
    When we calculate the CST/VAT it considers tool amortization cost also for basic price due to this we need to pay additional VAT or CST .
    Is there any provision can be made in MM pricing procedure for ZAMT or in TAXINN for VAT/CST to exclude tool amortization cost.
    Please reply
    Guru

    Have your pricing procedure as follows:-
    100::::PR00::::::Base Price
    110::::ZAMT:::::Tool Cost:::::::::::::100
    120:::::::::::::::Total for ED:::::::::::100::::110
    130::::ZVAT:::::VAT on Base Price::::100
    140::::ZCST:::::CST on Base Price::::100
    G. Lakshmipathi

  • VAT calculation is wrong!!

    Hi,
    Its concerned to Indian Excise.
    <b>Scenario:</b>
    1)Tax code contains only 4% VAT & other excise duty is added manually in PO conditions.
    2)In PO, VAT  Calculation is correct
    3)During invoice verifiavtion with ref to PO,Assessable values are flowing to MIRO for all line items of PO.
    <b>Error:</b> when appropriate tax code is selected (Only 4% VAT) for each line item in MIRO,VAT value which is being calculated is not exactly equals to 4% instead its diiferent for each line items like 4.19%,4.74%,4.09% and 4.37%.
    Can you pls advise,what is reason for this small difference in VAT calculation.
    Regds

    Hi,
    I checked in detail,other things are correct.
    But one more point is,infact there are 2 POs & 1 Invoice related to above issue.If I try to do MIRO for both POs together this Difference in VAT amount is reflecting as said before,If individual PO is considered for Invoice verification there is no such difference in VAT amount i can post the document.
    Regds

  • VAT calculation going wrong in dealer invoice

    Hi All,
    I am doing a dealer purchase scenario where in am giving basic price inclusive of excise in the PO and then while capturing excise invoice am changing the base value and excise duties manually in MIGO by checking MRP indicator such that sum of excise base value and excise duty is equal to PO price and similarly am changing base while doing MIRO but am still not getting the VAT correct.
    for example
    PO price excluding VAT - 102,490.00
                                   VAT - 4,099.60 + 1,024.90
    Excise duties =  6,394.00 + 128.00 + 64.00
    In MIGO i have changed base value as 95,904.00 and captured and posted the above excise duties. In MIRO i have changed base value as 95,904.00 and selected the tax code with excise 10.3 and VAT 4+1. Excise duties are coming as in excise invoice  but VAT is being calculated based on PO price + (excise duty based on the base value in Excise Invoice i.e., )
    Plz suggest
    Edited by: SAp321436 on Jan 12, 2011 6:16 AM

    hi
    what are the exicse % you have maintained in TAX CODE
    it should be zero
    like excise =0
    cess=0
    secess=0
    and vat =4
    vat1 =1
    ASSIGN ACCOUNTS for all conditions including excise
    now check
    regards
    kunal
    now use this code

  • Column calculations getting wrong will exporting report to excel

    Hi Experts,
    we have a report on obiee 11.1.1.5.0 with following details
    we have report with columns destination region,service , origin country and revenue
    and report is created as follows
    Destination Region
    Asia NorthAmerica Total(using selection steps included both country)
    June July June July June July
    Origin
    Country
    India 25% 75% 50% 50% 37.5% 62.5%
    China 96% 4% 96% 4% 96% 4%
    Brazil 78% 22% 72% 28% 75% 25%
    the logic i have used here is :- i have revenue and in pivot have applied SHOW DATA AS PERCENT OF LAYER(DESTINATION GEOGRAPHY)
    till here everything is fine but when i export it to excel then i get this all values divided by 100 for eg:-
    Destination Region
    Asia NorthAmerica Total(using selection steps included both country)
    June July June July June July
    Origin
    Country
    India 0.25% 0.75% 0.50% 0.50% 0.375% 0.625%
    China 0.96% 0.4% 0.96% 0.4% 0.96% 0.4%
    Brazil 0.78% 0.22% 0.72% 0.28% 0.75% 0.25%
    any suggestions how to get rid of this problem

    Ankit,
    Did you check this?
    Calculated Percentage Columns in Pivot Table loose formating in Excel
    Regards,
    Dpka

  • Simple calculation - but wrong output?

    I have:
    System.out.println(3 * 0.2);But the outputs 0.6000000000000001 instead of 0.6.
    Why?

    [Performing exact calculations with floating-point numbers|http://java.sun.com/developer/JDCTechTips/2001/tt0807.html#tip1]
    [Some things you should know about floating-point arithmetic|http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2].
    [What Every Computer Scientist Should Know About Floating-Point Arithmetic|http://docs.sun.com/source/806-3568/ncg_goldberg.html]
    [Floating point - From Wikipedia, the free encyclopedia|http://en.wikipedia.org/wiki/Floating_point]
    ~

  • The calculator is wrong

    Hello
    I've got Mac 21" late 2012. Downloaded Yosemite two days ago and the new calculator does not work properly. I used it too much (it's wonderful when you use a calculator on a big display), I need it much and now I'm disappointed. This is unbelievable. Is it possible to send an email to Apple and to tell them? If it is, please write down the address. Thank you in advance. Tatjana

    For example:
    I type 10 and then 2 and then % and the result is 0.02.
    When I use those buttons in that sequence, 102 appears in the display and when I press  % I see 1.02 in the display.
    You appear to be have left out some key-presses [e.g., the Enter key] in your description and/or are using Reverse Polish Notation. Have you set the calculator to use RPN mode (Reverse Polish Notation)? RPN Calculator use is definitely an "acquired taste". Most folks hate it, but a few can't live without it.
    Most Reverse Polish Notation operators appear AFTER the operands, and operate on the number in the display with the number on the top of a (traditionally four-element) STACK, a concept not used in "regular" calculators (except a few made by Hewlett Packard).
    To perform what you appear to want on a "regular" calculator, you express these in a vaguely algebraic stream of consciousness. number, operator, number, Equals. (e.g., 1 plus 2 Equals -- and the display shows 3)
    The percent key on a "regular" calculator does NOT operate on anything except the number on display. It ONLY expresses the current number on display as a percentage, as if you had added the percent symbol to the number in the display then expressed it as a decimal value instead. --  it does NOT compute x percent of y. I believe operates the same way on a RPN mode calculator.  So I believe it is operating correctly. When you press the percent key and it expresses the 2 in the display as 0.02, or two percent, which is correct.
    If you wanted 2 percent of 10, use the DIVIDE function: (2 Enter, 10, Divide) and follow it with the percent symbol when you transcribe it to your documents, or press the percent key to show it as a decimal percentage.
    -Or- first express 2 as a percentage by typing 2 pressing the % key, Enter, 10, Multiply (to take 2 percent of ten) yielding 0.2.
    In Reverse Polish Notation, the ADD function operates on the element on display plus the top number on the stack. 1 Enter 2 Add yields 3, the number on display plus the number from the top of the stack. 1 Enter 2 Enter yields 4 (the 2 on display and the 2 on the top of the stack are added.

Maybe you are looking for