<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculation Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605652#M597136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before ur calculationpart use this check.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IF( INT_DATA-MENGE_O + INT_DATA-MENGE_R) IS NOT INITIAL .&amp;lt;/b&amp;gt;INT_DATA-MENGE_PC = INT_DATA-MENGE_S / ( INT_DATA-MENGE_O + INT_DATA-MENGE_R ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Regards&lt;/P&gt;&lt;P&gt;Debjani&lt;/P&gt;&lt;P&gt;Reward points for helpful answer&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2007 11:31:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-02T11:31:19Z</dc:date>
    <item>
      <title>Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605646#M597130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this type of calculation it goes to Dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INT_DATA-MENGE_PC = INT_DATA-MENGE_S  /  ( INT_DATA-MENGE_O + INT_DATA-MENGE_R ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dump is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Division by 0 (type P) in program "ZM_REPT_STOCK_RECONCILIATION1"                                                                                &lt;/P&gt;&lt;P&gt;What happened?                                                                                &lt;/P&gt;&lt;P&gt;Error in ABAP application program.                                                                                &lt;/P&gt;&lt;P&gt;The current ABAP program "ZM_REPT_STOCK" had to be terminated       &lt;/P&gt;&lt;P&gt; because one of the                                                                 &lt;/P&gt;&lt;P&gt;statements could not be executed.                                                                                &lt;/P&gt;&lt;P&gt;This is probably due to an error in the ABAP program.                                                                                &lt;/P&gt;&lt;P&gt;What can you do?                                                                                &lt;/P&gt;&lt;P&gt;Print out the error message (using the "Print" function)                            &lt;/P&gt;&lt;P&gt;and make a note of the actions and input that caused the                            &lt;/P&gt;&lt;P&gt;error.                                                                                &lt;/P&gt;&lt;P&gt;To resolve the problem, contact your SAP system administrator.                      &lt;/P&gt;&lt;P&gt;You can use transaction ST22 (ABAP Dump Analysis) to view and administer            &lt;/P&gt;&lt;P&gt; termination messages, especially those beyond their normal deletion                &lt;/P&gt;&lt;P&gt;date.                                                                                &lt;/P&gt;&lt;P&gt;Error analysis                                                                                &lt;/P&gt;&lt;P&gt;An exception occurred. This exception is dealt with in more detail below          &lt;/P&gt;&lt;P&gt;. The exception, which is assigned to the class 'CX_SY_ZERODIVIDE', was neither   &lt;/P&gt;&lt;P&gt;caught nor passed along using a RAISING clause, in the procedure "SELECTION"      &lt;/P&gt;&lt;P&gt; "(FORM)"                                                                         &lt;/P&gt;&lt;P&gt;.                                                                                &lt;/P&gt;&lt;P&gt;Since the caller of the procedure could not have expected this exception          &lt;/P&gt;&lt;P&gt; to occur, the running program was terminated.                                    &lt;/P&gt;&lt;P&gt;The reason for the exception is:                                                  &lt;/P&gt;&lt;P&gt;In the current program "ZM_REPT_STOCK_RECONCILIATION1", an arithmetic operation   &lt;/P&gt;&lt;P&gt; ('DIVIDE',                                                                       &lt;/P&gt;&lt;P&gt;'/', 'DIV', or 'MOD') with a type P operand attempted to divide                   &lt;/P&gt;&lt;P&gt;by 0.                                                                                &lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sreedhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:23:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605646#M597130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605647#M597131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sreedhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this code&lt;/P&gt;&lt;P&gt;INT_DATA-MENGE_PC = INT_DATA-MENGE_S / ( INT_DATA-MENGE_O + INT_DATA-MENGE_R ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the value of INT_DATA-MENGE_O + INT_DATA-MENGE_R  happens to be ZERO then you get this message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do to avoid this is, Before dividing check if INT_DATA-MENGE_O + INT_DATA-MENGE_R  ne 0.&lt;/P&gt;&lt;P&gt;in other words,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_temp type datatype.&lt;/P&gt;&lt;P&gt;lv_temp = INT_DATA-MENGE_O + INT_DATA-MENGE_R .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_temp ne 0.&lt;/P&gt;&lt;P&gt;INT_DATA-MENGE_PC = INT_DATA-MENGE_S / ( INT_DATA-MENGE_O + INT_DATA-MENGE_R ).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Reward points for helpful answers.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605647#M597131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605648#M597132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sreedhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As it is clearly stated from the stack dump that some of the statement is in advertly changing the dinominator of the expression to 0 and hence it is giving t his error. So put a break point in the code and check the values of the variables that are used in the code and check the values of the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that this will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Rewards points for useful answers.&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605648#M597132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605649#M597133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the value of int_data-menge_o + int_data-menger is 0 here..&lt;/P&gt;&lt;P&gt;either both of dem r 0 or both 've same value wid opposite sign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so u should program a check dat if int_data-menge_o + int_data-menge_r is not zero den ur statement should be executed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:28:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605649#M597133</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2007-08-02T11:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605650#M597134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INT_DATA-MENGE_O + INT_DATA-MENGE_R  = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can't divide by zero&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add condition to check and prevent this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yossi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:29:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605650#M597134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605651#M597135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,.&lt;/P&gt;&lt;P&gt;When you adding the INT_DATA-MENGE_O and_DATA-MENGE_R, the Sum is comming as 0, so that the dump is coming, can you look at the values INT_DATA-MENGE_O and DATA-MENGE_R,  anyone of these values should come more than 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Change the code like this..&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data: L_SUM type MENGE.

L_SUM = INT_DATA-MENGE_O + INT_DATA-MENGE_R.
if L_SUM = '0'.
 L_SUM = 1.
endif.

INT_DATA-MENGE_PC = INT_DATA-MENGE_S / L_SUM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:29:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605651#M597135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605652#M597136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before ur calculationpart use this check.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IF( INT_DATA-MENGE_O + INT_DATA-MENGE_R) IS NOT INITIAL .&amp;lt;/b&amp;gt;INT_DATA-MENGE_PC = INT_DATA-MENGE_S / ( INT_DATA-MENGE_O + INT_DATA-MENGE_R ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Regards&lt;/P&gt;&lt;P&gt;Debjani&lt;/P&gt;&lt;P&gt;Reward points for helpful answer&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-problem/m-p/2605652#M597136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T11:31:19Z</dc:date>
    </item>
  </channel>
</rss>

