<?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: wrong calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473368#M556352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi khan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try &amp;lt;b&amp;gt;clearing itab&amp;lt;/b&amp;gt; also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this might solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if this solves ur problem.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 12:28:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-04T12:28:04Z</dc:date>
    <item>
      <title>wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473367#M556351</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;                 I have a customer balance report. in some customer A/c No. the calculation is wrong. Mostly it makes it double. i.e if any cust. a/c has 2 Debit 1,200 each. Its must show the total 2,400. but its showing 4,800. this problem is there is some A/c. is there any problem in my Loop. If there is any problem in loop then why other cust. A/c are showing correctly. for ur refrence below is the loop code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY KUNNR.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  IF ITAB-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;    WCREDIT = WCREDIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;  ELSEIF ITAB-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;    WDEBIT = WDEBIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB-CREDIT = WCREDIT.&lt;/P&gt;&lt;P&gt;  ITAB-DEBIT  = WDEBIT.&lt;/P&gt;&lt;P&gt;  ITAB-AMOUNT = ITAB-CREDIT - ITAB-DEBIT.&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING ITAB TO FINAL.&lt;/P&gt;&lt;P&gt;  AT END OF KUNNR.&lt;/P&gt;&lt;P&gt;    APPEND FINAL.&lt;/P&gt;&lt;P&gt;    CLEAR : WCREDIT , WDEBIT.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any need to update the code. Plz help. i need it urgently. thanks. alot.&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 12:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473367#M556351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T12:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473368#M556352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi khan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try &amp;lt;b&amp;gt;clearing itab&amp;lt;/b&amp;gt; also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this might solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if this solves ur problem.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 12:28:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473368#M556352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T12:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473369#M556353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY KUNNR.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;IF ITAB-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;WCREDIT = WCREDIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;ELSEIF ITAB-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;WDEBIT = WDEBIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-CREDIT = WCREDIT.&lt;/P&gt;&lt;P&gt;ITAB-DEBIT = WDEBIT.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = ITAB-CREDIT - ITAB-DEBIT.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING ITAB TO FINAL.&lt;/P&gt;&lt;P&gt;APPEND FINAL.&lt;/P&gt;&lt;P&gt;CLEAR : WCREDIT , WDEBIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;Itab final1 will have only KUNNR and TOTALS of DEBIT,CREDIT,AMOUNT&lt;/P&gt;&lt;P&gt;SORT final BY KUNNR.&lt;/P&gt;&lt;P&gt;LOOP AT final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF KUNNR.&lt;/P&gt;&lt;P&gt;    read table final index sy-tabix.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING FINAL TO FINAL1.&lt;/P&gt;&lt;P&gt;APPEND FINAL1.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;clear final1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 12:29:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473369#M556353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T12:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473370#M556354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Khan,&lt;/P&gt;&lt;P&gt;Since it is Debit and Credit calculation , try to multiply debit value -1.&lt;/P&gt;&lt;P&gt;Reward if useful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 12:30:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473370#M556354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T12:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473371#M556355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Khan, &lt;/P&gt;&lt;P&gt;If you send your select statement or full code probably i can help you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antony Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 12:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473371#M556355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T12:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473372#M556356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thomas,&lt;/P&gt;&lt;P&gt;                Below is the code with select statement. plz help me out.&lt;/P&gt;&lt;P&gt;********************************************************************************************&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS :  S_BUKRS    FOR BSEG-BUKRS NO-EXTENSION  NO INTERVALS ,&lt;/P&gt;&lt;P&gt;                  S_KUNNR    FOR BSEG-KUNNR ,&lt;/P&gt;&lt;P&gt;                  S_ERDAT    FOR BKPF-BUDAT OBLIGATORY  DEFAULT SY-DATUM  TO SY-DATUM .&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK B1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BELNR BUDAT FROM BKPF INTO (WBELNR , WBUDAT ) WHERE BUDAT IN S_ERDAT.&lt;/P&gt;&lt;P&gt;  SELECT DMBTR KUNNR KOART SHKZG  FROM BSEG INTO (ITAB-DMBTR ,ITAB-KUNNR , ITAB-KOART ,ITAB-SHKZG)&lt;/P&gt;&lt;P&gt;                       WHERE  BUKRS IN S_BUKRS&lt;/P&gt;&lt;P&gt;                       AND    KUNNR IN S_KUNNR&lt;/P&gt;&lt;P&gt;                       AND    KOART EQ 'D'&lt;/P&gt;&lt;P&gt;                       AND    AUGBL EQ SPACE&lt;/P&gt;&lt;P&gt;                       AND    ( UMSKZ EQ SPACE OR UMSKZ EQ 'A')&lt;/P&gt;&lt;P&gt;                       AND   BELNR = WBELNR.&lt;/P&gt;&lt;P&gt;    APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  SELECT SINGLE NAME1 ORT01 FROM KNA1 INTO (ITAB-NAME , ITAB-ORT01) WHERE KUNNR = ITAB-KUNNR.&lt;/P&gt;&lt;P&gt;  MODIFY  ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;SORT ITAB BY KUNNR.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  IF ITAB-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;    WCREDIT = WCREDIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;  ELSEIF ITAB-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;    WDEBIT = WDEBIT + ITAB-DMBTR.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB-CREDIT = WCREDIT.&lt;/P&gt;&lt;P&gt;  ITAB-DEBIT  = WDEBIT.&lt;/P&gt;&lt;P&gt;  ITAB-AMOUNT = ITAB-CREDIT - ITAB-DEBIT.&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING ITAB TO FINAL.&lt;/P&gt;&lt;P&gt;  AT END OF KUNNR.&lt;/P&gt;&lt;P&gt;    APPEND FINAL.&lt;/P&gt;&lt;P&gt;    CLEAR : WCREDIT , WDEBIT.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. alot.&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 04:14:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473372#M556356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T04:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473373#M556357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Anji,&lt;/P&gt;&lt;P&gt;         Thanks for replying. IS your code also works for range of Cust. A/c like If on selection screen I enter PC04000001 To PC04000009. or ur code is just for single entry? Coz I think At End of KUNNR code should be before end of first ENDLOOP. Plz clearify me. &lt;/P&gt;&lt;P&gt;Thanks Alot.&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 04:27:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473373#M556357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T04:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: wrong calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473374#M556358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;answred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 10:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-calculation/m-p/2473374#M556358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T10:58:54Z</dc:date>
    </item>
  </channel>
</rss>

