<?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: Problem with Collect statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150012#M749036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shibaji Maitra ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are aggregating the it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.&lt;/P&gt;&lt;P&gt;For using the Collect statement the order of the fields should be &lt;/P&gt;&lt;P&gt;in proper order i.e. all the char fields come up &amp;amp; then after that&lt;/P&gt;&lt;P&gt;all the numeric fields.Please check the sequence in your internal&lt;/P&gt;&lt;P&gt;table and also the fields type of menge field.&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;STRONG&gt;LOOP AT it_ekbe_642_pgi.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;it_ekbe_642_pgi_tot-ebeln = it_ekbe_642_pgi-ebeln.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;it_ekbe_642_pgi_tot-ebelp = it_ekbe_642_pgi-ebelp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-xblnr = it_ekbe_642_pgi-xblnr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-budat = it_ekbe_642_pgi-budat.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-menge = it_ekbe_642_pgi-menge.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;COLLECT it_ekbe_642_pgi_tot.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDLOOP.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Manoj Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2007 08:59:18 GMT</pubDate>
    <dc:creator>former_member402443</dc:creator>
    <dc:date>2007-12-19T08:59:18Z</dc:date>
    <item>
      <title>Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150005#M749029</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 facing a peculiar problem. Please go through the code below and it is not giving the aggregate of it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_ekbe_642_pgi.&lt;/P&gt;&lt;P&gt;    it_ekbe_642_pgi_tot-ebeln =   it_ekbe_642_pgi-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_ekbe_642_pgi_tot-ebelp =   it_ekbe_642_pgi-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_ekbe_642_pgi_tot-budat =   it_ekbe_642_pgi-budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_ekbe_642_pgi_tot-xblnr =   it_ekbe_642_pgi-xblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_ekbe_642_pgi_tot-menge =   it_ekbe_642_pgi-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    COLLECT it_ekbe_642_pgi_tot.&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;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shibaji.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 07:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150005#M749029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T07:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150006#M749030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Table EKBE holds the receipt documents for a purchase order. When you have several receipts on a purchase order item but with a different posting date (BUDAT) or reference (XBLNR) the collect statement will create a new record in yoy internal table. Only numeric fields are aggregated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:04:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150006#M749030</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2007-12-19T08:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150007#M749031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jack,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to aggregate the numeric field (menge) with same ebeln, ebelp, budat and with different xblnr. But, it is overwriting on the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the problem in the code..&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;&lt;/P&gt;&lt;P&gt;Shibaji.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150007#M749031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T08:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150008#M749032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then XBLNR should be left blank otherwise different references (XBLNR) will result in different records in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150008#M749032</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2007-12-19T08:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150009#M749033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jack,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to aggregate the numeric field (menge) with same ebeln, ebelp, budat and with different xblnr. But, it is overwriting on the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the problem in the code..&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;&lt;/P&gt;&lt;P&gt;Shibaji.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:43:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150009#M749033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150010#M749034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your internal table definition of it_ekbe_642_pgi_tot-menge might not be numeric ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150010#M749034</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2007-12-19T08:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150011#M749035</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;Declare internal table  fields datatyps should be same as database fields which you are referring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more point is if you are not considering xblnr for cumulation of quantites dont put that in loop while using collect stmt.&lt;/P&gt;&lt;P&gt;afterwards you move xblnr with modify stmt into 2nd internal table.&lt;/P&gt;&lt;P&gt;when budat is also same only (not only ebeln ebelp ) qty will be cumulated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Sivaparvathi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:57:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150011#M749035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T08:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150012#M749036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shibaji Maitra ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are aggregating the it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.&lt;/P&gt;&lt;P&gt;For using the Collect statement the order of the fields should be &lt;/P&gt;&lt;P&gt;in proper order i.e. all the char fields come up &amp;amp; then after that&lt;/P&gt;&lt;P&gt;all the numeric fields.Please check the sequence in your internal&lt;/P&gt;&lt;P&gt;table and also the fields type of menge field.&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;STRONG&gt;LOOP AT it_ekbe_642_pgi.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;it_ekbe_642_pgi_tot-ebeln = it_ekbe_642_pgi-ebeln.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;it_ekbe_642_pgi_tot-ebelp = it_ekbe_642_pgi-ebelp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-xblnr = it_ekbe_642_pgi-xblnr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-budat = it_ekbe_642_pgi-budat.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;it_ekbe_642_pgi_tot-menge = it_ekbe_642_pgi-menge.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;COLLECT it_ekbe_642_pgi_tot.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDLOOP.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Manoj Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 08:59:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150012#M749036</guid>
      <dc:creator>former_member402443</dc:creator>
      <dc:date>2007-12-19T08:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150013#M749037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai Shibaji Maitra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                         i think ur problem is to collect the fields only when xblnr is changed.if it is right u must use &lt;STRONG&gt;on change of&lt;/STRONG&gt; bcz the collect statement collects the field when a single value of left of ur field (it_ekbe_642_pgi_tot) which u are going to collect(it_ekbe_642_pgi_tot) changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think this might be usefull for u.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 09:09:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150013#M749037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150014#M749038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all ... my problem got resolved.&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;Shibaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 05:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-collect-statement/m-p/3150014#M749038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T05:43:26Z</dc:date>
    </item>
  </channel>
</rss>

