<?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: collect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180713#M463629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collect statement will add the numeric fields automatically.&lt;/P&gt;&lt;P&gt;Just try this simple code it will work.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write: / itab-sno,itab-sname,itab-smarks.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Apr 2007 10:54:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-25T10:54:07Z</dc:date>
    <item>
      <title>collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180712#M463628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the itab contains the following fields.&lt;/P&gt;&lt;P&gt;sno&lt;/P&gt;&lt;P&gt;sname&lt;/P&gt;&lt;P&gt;smarks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sno sname smarks&lt;/P&gt;&lt;P&gt;1     srinivas 100&lt;/P&gt;&lt;P&gt;2     sri         99&lt;/P&gt;&lt;P&gt;3     srija       89&lt;/P&gt;&lt;P&gt;4     srinivas 45&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using the collect statement i have to add numeric fields and print.how can i write the collect statement plz expalin me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 10:51:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180712#M463628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T10:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180713#M463629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collect statement will add the numeric fields automatically.&lt;/P&gt;&lt;P&gt;Just try this simple code it will work.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write: / itab-sno,itab-sname,itab-smarks.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 10:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180713#M463629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T10:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180714#M463630</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;First of all the sno field has to be char field, then simply COLLECT ITAB, if the itab contains header line. or collect wa into itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amitava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 10:55:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180714#M463630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T10:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180715#M463631</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;collect is just like append statement.where it compares all the record in the body with the record present in the field string...if the record does not exists then it gets appended or else if they r integer values then they get added even numeric values get added if the record exists..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u feel tht it is an useful answer then reward with points,&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;madhuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 13:38:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180715#M463631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T13:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180716#M463632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i t adds numeric fields  if a similar record exists els it appends it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ur exp &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;each record is unique they gets appeds at end  it does not adds.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u have again record with sam info but diff nueric field it adds..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 13:43:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180716#M463632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T13:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180717#M463633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you have the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT [wa INTO] itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will autometically add up the neumerical velues when the other character fields remail same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 13:48:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180717#M463633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T13:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180718#M463634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Summarized sales figures by company: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF COMPANY, 
        NAME(20) TYPE C, 
        SALES    TYPE I, 
      END OF COMPANY. 

DATA: COMP    TYPE COMPANY, 
      COMPTAB TYPE HASHED TABLE OF COMPANY 
                                WITH UNIQUE KEY NAME. 

COMP-NAME = 'Duck'.  COMP-SALES = 10. COLLECT COMP INTO COMPTAB. 
COMP-NAME = 'Tiger'. COMP-SALES = 20. COLLECT COMP INTO COMPTAB. 
COMP-NAME = 'Duck'.  COMP-SALES = 30. COLLECT COMP INTO COMPTAB&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table COMPTAB now has the following contents: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          NAME    | SALES &lt;/P&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;          Duck    |   40 &lt;/P&gt;&lt;P&gt;          Tiger   |   20&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 13:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180718#M463634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T13:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180719#M463635</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;sno sname smarks&lt;/P&gt;&lt;P&gt;1 srinivas 100&lt;/P&gt;&lt;P&gt;2 sri 99&lt;/P&gt;&lt;P&gt;3 srija 89&lt;/P&gt;&lt;P&gt;4 srinivas 45&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sno should be a non-numeric  field. After using collect instead append the result &lt;/P&gt;&lt;P&gt;will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 srinivas 100&lt;/P&gt;&lt;P&gt;2 sri 99&lt;/P&gt;&lt;P&gt;3 srija 89&lt;/P&gt;&lt;P&gt;4 srinivas 45&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as sno sname fileds combination is unique for all the rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &lt;/P&gt;&lt;P&gt;1 srinivas 100&lt;/P&gt;&lt;P&gt;2 sri 99&lt;/P&gt;&lt;P&gt;3 srija 89&lt;/P&gt;&lt;P&gt;1 srinivas 45&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then result of collect is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 srinivas 145&lt;/P&gt;&lt;P&gt;2 sri 99&lt;/P&gt;&lt;P&gt;3 srija 89&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If helpful reward points,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tanmay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2007 13:51:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect/m-p/2180719#M463635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-25T13:51:16Z</dc:date>
    </item>
  </channel>
</rss>

