<?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: Sub total error in smartform in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-error-in-smartform/m-p/2041600#M419846</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;Basically you might be doing the sub total calculation inside the loop before the funciton module which you will be calling in the program to pass values to smartform. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just pass the values and then do the calculation before the endloop. Below i have expalined you taking scripts as an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See in scripts we will call write_form inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So previously i was doing the subtotal calulation before calling the funciton "write_form".then the same error occured.&lt;/P&gt;&lt;P&gt;Then i have changed it like this given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at ITAB.&lt;/P&gt;&lt;P&gt; Call write_form&lt;/P&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subtotal = -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please let me know if you are not clear, so that i can try to explain in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2007 11:55:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-22T11:55:00Z</dc:date>
    <item>
      <title>Sub total error in smartform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-error-in-smartform/m-p/2041599#M419845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table in the main window of a smart form. The subtotal of the line items is printed in everypage and the grand total at the end of the main window or at the last page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem is if there are 4 records in first page and 2 records in second page,the subtotal in the first page is picking first line item from the second page (i.e the 5th line item)and printing a wrong subtotal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But grand total is calculated correctly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know the solution for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2007 11:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-error-in-smartform/m-p/2041599#M419845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-22T11:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sub total error in smartform</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-error-in-smartform/m-p/2041600#M419846</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;Basically you might be doing the sub total calculation inside the loop before the funciton module which you will be calling in the program to pass values to smartform. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just pass the values and then do the calculation before the endloop. Below i have expalined you taking scripts as an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See in scripts we will call write_form inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So previously i was doing the subtotal calulation before calling the funciton "write_form".then the same error occured.&lt;/P&gt;&lt;P&gt;Then i have changed it like this given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at ITAB.&lt;/P&gt;&lt;P&gt; Call write_form&lt;/P&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subtotal = -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please let me know if you are not clear, so that i can try to explain in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2007 11:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-error-in-smartform/m-p/2041600#M419846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-22T11:55:00Z</dc:date>
    </item>
  </channel>
</rss>

