Update Rules : Divide by zero error

Hi All,
I am calculating Condition Rate for billing using formula KWERT/FKIMG i.e. amount/quantity. Its giving me divide by zero error when FKIMG = 0.
Can we prevent division by 0 error like we can do it in query formula uding NDIV0.
Thanks
PB

Hi,
you can write routine to avoid the error.
if quantity <> 0.
  conditon rate = amount /quantity
else
  conditon rate = space or zero (according to your requirement)
endif.
Message was edited by:
        Siva Chidambaram

Similar Messages

  • Help: Divide by Zero Errors

    Hi, can someone please advise me on how to avoid script failure alerts (like the one below), which are generated because certain calculations are being performed before any positive value has yet been set in a numeric field?
    Here is an example of the calculation:
    --- form1.SF_CalculationTable.acview[0]::calculate - (FormCalc, client) --
    (ac[0] / tr[0]) * 100
    Error example:
    Script failed (language is formcalc; context is
    xfa[0].form[0].form1[0].SF_CalculationTable[0].acview[0])
    script=(ac[0] / tr[0]) * 100
    Error: arithmetic over/underflow.
    update: it appears these erros are "divide by zero" errors.
    So my questions are,
    (1) would I put any javascript (to override the zeros) on the "validate" event or the "calculate" event, and on which of the three fields in question, acview[0] (the result), tr[0] (the denominator) or ac[0] (the numerator). and...
    (2) What might that javascript look like?
    Harry

    Your error message indicates your script is being executed as FormCalc, not JavaScript.
    If you're using FormCalc try using an If statment to test for zero/null.
    if (tr>0) then (ac/tr)*100 endif

  • Divide by zero error encountered

    Dear All,
    When our customer process PO, they got an error like below:
    Divide by zero error encountered. Tax definition [ovcg]
    They also got Divide by zero error encountered. Outgoing payments  [ovpm]
    They can process their business but we need to know why and how to fix this error for them.
    Any idea? Thanks.
    Regards,
    Yuka

    Hi,
    You need to check the FMS defined on the row level of the document you want to add.
    Remove the FMS and you will not get the error message reported.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Divided by zero error

    All,
    I am having trouble with one of the reports in EBS.
    When I run the two underlying sql of the report in toad I get the data.
    But, when I ran the report from the application I was getting some oracle error.
    So, I ran the report directly from the reports builder to see what error I am getting.
    It turns out that I am getting divided by zero error.
    I am passing in the org id and gl dates an inputs the report.
    Please help me debug the report.

    Could you check if your report has any subquery that doesn't return any record when the parameters are submitted at run time.
    I had the issue in Crystal Reports where it threw a divide by 0 error.

  • SQL to avoid Dreaded "Divide by Zero" error

    Hey,
    I have been banging my head off the decode and NVL functions to avoid the divide by zero error, can tfor the life of me get it.
    2 columns, a & b.
    Need to get: a/b (but the whole thing fails if either is null or zero)
    Any help greatly appreciated.
    Dob

    VG2 wrote:
    You need something like
    decode( b, 0, to_number(null),
    b, null, to_number(null),
    a/b )What is that?
    in psuedo language with that statement you are saying...
    If b is zero then return to_number(null) (which is the same as null) else
    if b is null then to_number(null) (which is still null) else
    a/b
    surely it's just a case of saying
    nvl(a,0)/nvl(b,1)which assumes that if b is null it should not effect a and if a is null then the result should be zero.

  • Arithmetic Overflow/Underflow and Divide by Zero Errors

    We're having problems similar to those posted below (see links), especially "Help: Divide by Zero Errors" to which no one has addressed. <br /><br />Here's our situation: On our form, we have two columns that sum the rows above them, called<br /><br />"covertotal" and "multtotal"<br /><br />...for which we need a final calculation: multtotal/covertotal<br /><br />Under calcutions in FormCalc, we have generated the following formula for the box called "prevtotal" under the calculate command: <br /><br />(multtotal / covertotal)<br /><br />However, since this calculation runs when the document is opened, we get a divide by zero error. Do we need to create an initialize or calculate formula to correct for this zero? If so, what is the proper coding.<br /><br />Please spell this out, we're that stupid... <sigh><br /><br />Thanks!<br /><br />Matthew<br /><br />Previous posts with similar problems are linked below:<br /><br />Help: Divide by Zero Errors<br /><a href="/cgi-bin/webx?14@@.3bbd2077">Harry Kontos, "Help: Divide by Zero Errors" #, 6 Nov 2005 10:01 pm</a><br /><br />calculations overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbeb7e0<br /><br />FormCalc error-arithmetic overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbc15f3

    Your error message indicates your script is being executed as FormCalc, not JavaScript.
    If you're using FormCalc try using an If statment to test for zero/null.
    if (tr>0) then (ac/tr)*100 endif

  • Roxio "divide by zero" error

    I have printed a dozen or so DVDs using my HP 5200 series printer and the same ink-jet printable DVDs that I'm now trying to print to.  Now when I try to print I am getting a "divide by zero" error message and the software locks up.  The only way to regain control of the computer is touse task manager to shut the Roxio software down.  After restarting several times with same results I uninstalled/reinstalled the software from the HP installation CD and still am getting the error.
    First question is if someone has found a fix.  Second question is of someone has found good software for printing to discs usint the 5200 series printers.  I'm not satisfied with the Roxio product and certainly won't upgrade from the free version if I can't get it working.  I have Nero 7 but I don't believe it will work for printint directly to disc using the 5200 series printers.

    i'm having the exact same problem with the labeling software..... i would greatly appreciate an answer to this spoof-auf. i'm using 3.2.1.28 express  .... 

  • SSRS Expression divide by zero error

    Hi, I am getting an error in SSRS calculating the field that potentially divide by zero. may i ask your help to fix this issue. thanks.
    =First(Fields!CEQ_all.Value, "DailyUpdates_DS") = value is zero
    =Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")= value is 0.16
    --This is the codes in my field expression
    =IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS"),Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")/First(Fields!CEQ_all.Value, "DailyUpdates_DS"),1)

    try like this
    =IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS"),Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")/IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>0,First(Fields!CEQ_all.Value, "DailyUpdates_DS"),Nothing),1)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • This Query IS giving divide by zero error when executed in sql plus

    UPDATE grn G
    SET g.OPT_WA_FAIR_VAL_A = (SELECT
    ROUND(SUM(NVL(ga.OPT_FAIR_VAL_A, 0) * NVL(gvs.GRN_VEST_OPT_Q, 0)) / SUM(NVL(gvs.GRN_VEST_OPT_Q, 0)), 6)
    FROM
    GRANT_VESTING_SCHEDULE gvs,
    GRANT_ASSUMPTION ga
    WHERE
    gvs.ORG_GRP_I = ga.ORG_GRP_I AND
    gvs.grn_n = ga.grn_n AND
    ga.ORG_GRP_I = g.ORG_GRP_I AND
    ga.GRN_N = g.GRN_N AND
    NVL(ga.GRN_ASMPN_EFF_D, gvs.grn_vest_d) <= gvs.grn_vest_d AND
    NVL(ga.GRN_ASMPN_END_D, gvs.grn_vest_d) >= gvs.grn_vest_d
    WHERE G.ORG_GRP_I =5
    Any suggestions

    hi
    What should be result if divide by zero e.g
    SQL> SELECT * FROM emp;
        EMPNO ENAME        JOB             MGR HIREDATE        SAL      COMM    DEPTNO
         7901 SMITH        CLERK          7902 17-DEC-80         0         0        20
         7499 ALLEN        SALESMAN       7698 20-FEB-81      2100      1800        30
         7521 WARD         SALESMAN       7698 22-FEB-81      2300      2000        30
         7566 JONES        MANAGER        7839 02-APR-81      1000      3000        20
         7654 MARTIN       SALESMAN       7698 28-SEP-81      3200       700        30
         7698 BLAKE        MANAGER        7839 01-MAY-81      1000      3000        30
         7782 CLARK        MANAGER        7839 09-JUN-81      1000      3000        10
         7788 SCOTT        ANALYST        7566 19-APR-87      1000      1900        20
         7839 KING         PRESIDENT           17-NOV-81      1000      1700        10
         7844 TURNER       SALESMAN       7698 08-SEP-81      1800       700        30
         7876 ADAMS        CLERK          7788 23-MAY-87      1000      1300        20
         7900 JAMES        MANAGER        7698 03-DEC-81      1000      3000        30
         7902 FORD         ANALYST        7566 03-DEC-81      1000      2000        20
    13 rows selected.
    SQL> SELECT sal/DECODE(comm,0,1,comm) FROM emp;
    SAL/DECODE(COMM,0,1,COMM)
                            0
                    1.1666667
                         1.15
                    .33333333
                    4.5714286
                    .33333333
                    .33333333
                    .52631579
                    .58823529
                    2.5714286
                    .76923077
                    .33333333
                           .5
    13 rows selected.Khurram

  • Update rule to transformation migration error

    Error produced during update rule (BW3.5) to transformation migration. During start routine validation check it states that ' The data object 'COMM_STRUCTURE' has no component called 'BIC/ZCH_FABC1'  but there is a component called 'BIC/ZCH_FAAC1'.
    Even though this component is exist as part of communication structure, migration setup is producing an error.
    System is BI SP 16 level. OSS message is created, if you have experienced any similar issues, pls. share and let us know.
    Thanks, Vijay Rama.

    Hi VJ,
               The ideal best practice is to replace the Routines manually. As BI 7.0 wont hold Comm. structure, You are facing this problem.
    So you replace Comm.Structure to with Source_Fields.
    So while migrating the routines do it manually.
    You can find a lot of info in SDN if you search using the related terms
    regarding Migration.
    Hope this Helps
    Regards
    Karthik

  • DSO - Cube : Update Rule Error

    When trying to push data from an DSO to a ube, the request stays amber until finally short dumping.
    The update rule is activated and all key figures, characteristics and time characteristics are filled correctly from the DSO.
    The error message in the monitor of the request is:
    <i>Update Rules (15199 => 0 records) : Errors Occurred</i>
    How do I see the exact error description of what caused the update rule not to transfer any records? I can't seem to find much information in the monitor of what went wrong.
    Thanks in advance,
    Matt

    There is a characteristic called 'Reporting Week' that uses some routine to convert the a document  'created on' date in the week/year format (e.g 01.2008).
    Code of this routine is below. All other characteristics or key figures in this update rule are matched with source fields.
    fill the internal table "MONITOR", to make monitor ent *ries
    result value of the routine
    DATA: i_per(3) type n,
    i_year(4) type n.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
    EXPORTING
    I_DATE = COMM_STRUCTURE-createdon
    I_PERIV = 'ZW'
    IMPORTING
    E_BUPER = i_per
    E_GJAHR = i_year
    EXCEPTIONS
    INPUT_FALSE = 1
    T009_NOTFOUND = 2
    T009B_NOTFOUND = 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.
    concatenate i_year i_per+1(2) into RESULT.
    if the returncode is not equal zero, the result will not be updated
    RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
    ABORT = 0.

  • Update rules error urgent

    Hi friends,
    Iam uploading data Parallely ODS &CUBE.
    But iam getting Red in ODS and Yellow in CUBE.
    When i check the error in ods level.
    showing below error ...
    Update rules ( 12485  -> 0 Records ) : Errors occurred
    Fatal error in customer routine 9998.
    What does it mean?
    My routine progrm is written in ODS level like
    fill the internal table "MONITOR", to make monitor entries
      LOOP AT DATA_PACKAGE.
        IF DATA_PACKAGE-doc_categ NE 'C' AND
           DATA_PACKAGE-doc_categ NE 'I'.
          DELETE DATA_PACKAGE.
        elseif DATA_PACKAGE-recordmode eq 'R'.
          DATA_PACKAGE-recordmode = 'X'.
          modify DATA_PACKAGE.
        ENDIF.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    HERE ANY CHANGESS REQURIED?
    Kindly help me.
    Thanks in advance
    Ramya
    Message was edited by:
            ramya thulluru

    Hi Ramya,
    You would need to debug the code to find the exact place where it is failing.
    You would need to include an infinite loop in the start routine of the update rules. Your code may be as follows:
    data: t_debug_flag_start value 'X'.
    if t_debug_flag_start = 'X'.
    do.
    if t_debug_flag_start = ' '.
    exit.
    endif.
    enddo.
    endif.
    Now when you execute the infopackage you would find that a generated program GP*** in sm50. You can debug the generated program by changing the value of t_debug_start.
    Bye
    Dinesh

  • 'L_CHAVL_IN' Error while Activating Update Rules.

    Hi All,
          when i am tring to activate my update rules, it is giving error, field "L_CHAVL_IN' in unknown. I dont have that field in my objects.
       i found that field in 'Progarm' for the update rules. that field is used in the exit of one of the feild in the update rules.
        Please give me a solution how to solve this.
    Regards,
    Ramana.

    Check the following SAP Note (# 782858)
    <b>Symptom</b>
    When you activate the update rules, the system issues a syntax error: 'Syntax error: Field "L_CHAVL_IN" is unknown'.
    <b>Other terms</b>
    Syntax error; generation; l_chavl_in; update rules
    <b>Reason and Prerequisites</b>
    This is a program error. The error only occurs under the following circumstances:
    You generate an optimized update rule;
    An alpha conversion is required.
    <b>Solution</b>
    BW 3.0B
               Import Support Package 25 for BW 3.0B (BW3.0B Support Package 25 or SAPKW30B25) into your BW system. The Support Package will be available once note 0723254 with the short text, "SAPBWNews BW3.0B Support Package 25", which describes the Support Package in more detail, is released for customers.
    BW 3.10 Content
               Import Support Package 19 for BW 3.10 (BW3.10 Support Package 19 or SAPKW31019) into your BW system. The Support Package will be available once note 0723261 with the short text, "SAPBWNews BW 3.1 Content Support Package 19", which describes the Support Package in more detail, is released for customers.
    BW 3.50
               Import Support Package 10 for BW 3.5 (BW3.50 Support Package 10 or SAPKW35010) into your BW system. The Support Package will be available oncenote 0763336 with the short text, "SAPBWNews BW Support Package 10 NetWeaver'04 stack 10", which describes the Support Package in more detail, is released for customers.
    Assign pts if helpful.<b></b>

  • Update Rule error while loading the data

    Hello All,
    I tried to do the init load for the datasource 2LIS_02_VAKON (Sales Document Condition), But it error's out in the Update rule saying:
    Short text: Error when generating the update program
    Long Text:  Diagnosis
         An error occurred during program generation for InfoSource 2LIS_11_VAKON
         and InfoProvider 0SD_C15 . This may be extrapolated to incorrect update
         rules.
    Procedure
         Check and correct your update rules and then generate the update program
         again. You can find help on the error in the error log.
    The update rule looks very fine. I even deleted it and re created, but no success..... Please give me your thoughts abt it..... Any suggestions will be great for me.....

    Hello Gokul,
    I could'nt see any analyse button in RSMON. This is the only error message I could get from the Process monitor:
    Short text: Error when generating the update program
    Long Text: Diagnosis
    An error occurred during program generation for InfoSource 2LIS_11_VAKON
    and InfoProvider 0SD_C15 . This may be extrapolated to incorrect update
    rules.
    Procedure
    Check and correct your update rules and then generate the update program
    again. You can find help on the error in the error log.
    Do you expect something else ? Also I went through your OSS note, they are asking to apply support pack 18. Is this a serious issue to apply SP? Because in Quality and Prod it loads fine......
    Please let me know your idea

  • Error in the update rules

    Hi All,
       I added a BUOM Unit for a keyfigure and activated the cube.While I am activating the update rules it shows the error message unit for the Keyfigure is not recognized in the update rules . Kindly let me Know what i need to do for this error.
    Thanks In Advance...
    Raghu

    Hi,
    Make sure that the mapping for the unit of your KF is also selected in update rule.
    With rgds,
    Anil Kumar Sharma .P

Maybe you are looking for