<?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: sap scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385387#M187647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum = price * qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;totsum = totsum + sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use this for any number of records...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jun 2006 12:26:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-21T12:26:04Z</dc:date>
    <item>
      <title>sap scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385385#M187645</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;i am struck with some problem in script, can any one help me.  &lt;/P&gt;&lt;P&gt;my problem is i hv two fields total price &amp;amp; total qty, i hve to get the out put.  i wrote the code for that.  like that i have 4-5 fields or blocks, i need to get the total of all those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. total price * qty = total amount&lt;/P&gt;&lt;P&gt;2. total price * qty = total amount&lt;/P&gt;&lt;P&gt;3. total price * qty = total amount&lt;/P&gt;&lt;P&gt;4. total price * qty = total amount&lt;/P&gt;&lt;P&gt;                       -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;                 sum = xxxxxxxxxxxx&lt;/P&gt;&lt;P&gt;                       -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;the sum shld change dynamically as per no. of records, i mean, if i hve two records i shld get sum of total amount for two records. plz help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385385#M187645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: sap scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385386#M187646</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;Its very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take 2 variables (VAR1, VAR2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR1 - total of all fields within the record.&lt;/P&gt;&lt;P&gt;VAR2 - Sum of all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are in LOOP,&lt;/P&gt;&lt;P&gt;for each field while calculating total amount, add total amount to one variable (VAR1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;total amount = total price * total quantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 = var1 + total amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for each end of record (before end loop), assign the var1 to var2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var2 = var2 + var1.&lt;/P&gt;&lt;P&gt;clear var1.&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;Subba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385386#M187646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: sap scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385387#M187647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum = price * qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;totsum = totsum + sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use this for any number of records...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 12:26:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385387#M187647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T12:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: sap scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385388#M187648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can not do the manupulation of fields in script.&lt;/P&gt;&lt;P&gt;so write a PERFORM &amp;amp; define that FORM in any z program &amp;amp; pass all your field values &amp;amp; do the sum &amp;amp; revert it to the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 12:30:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385388#M187648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T12:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: sap scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385389#M187649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi use 'SUM' statement at end of your loop to get total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;call your text element to write values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&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;Regards,&lt;/P&gt;&lt;P&gt;Wasim Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 12:31:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/1385389#M187649</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-06-21T12:31:22Z</dc:date>
    </item>
  </channel>
</rss>

