<?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 statement using in report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594887#M2010523</link>
    <description>&lt;P&gt;Key should be unique to perform the collect statement. You can use loops on your internal table, and write the logic for addition or use SUM.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2018/06/15/new-abap-table-sum/" target="test_blank"&gt;https://blogs.sap.com/2018/06/15/new-abap-table-sum/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 12:24:46 GMT</pubDate>
    <dc:creator>Prasobh</dc:creator>
    <dc:date>2022-08-22T12:24:46Z</dc:date>
    <item>
      <title>collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594885#M2010521</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;Suppose, I want to use collect statement for matnr values and according to that I want sum of quantity field. but I get an error that we can use collect command if all non unique key fields are numeric. How to write the code for that Please anyone guide me.&lt;/P&gt;
  &lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594885#M2010521</guid>
      <dc:creator>ahanadasgupta_23</dc:creator>
      <dc:date>2022-08-22T12:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594886#M2010522</link>
      <description>&lt;P&gt;Please share your internal table on which you set a loop - to collect the sum of quantities.&lt;/P&gt;&lt;P&gt;Also share the piece of code on whihc you do collect.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594886#M2010522</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-08-22T12:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594887#M2010523</link>
      <description>&lt;P&gt;Key should be unique to perform the collect statement. You can use loops on your internal table, and write the logic for addition or use SUM.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2018/06/15/new-abap-table-sum/" target="test_blank"&gt;https://blogs.sap.com/2018/06/15/new-abap-table-sum/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:24:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594887#M2010523</guid>
      <dc:creator>Prasobh</dc:creator>
      <dc:date>2022-08-22T12:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594888#M2010524</link>
      <description>&lt;P&gt;Please indicate the &lt;STRONG&gt;EXACT&lt;/STRONG&gt; error message.&lt;/P&gt;&lt;P&gt;About using &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapcollect.htm"&gt;COLLECT, the documentation&lt;/A&gt; says: "All components that are not part of the primary table key must have a numeric data type."&lt;/P&gt;&lt;P&gt;How did you define your internal table, what is the primary table key, especially what components are &lt;STRONG&gt;NOT&lt;/STRONG&gt; part of the primary table key?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594888#M2010524</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-08-22T12:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594889#M2010525</link>
      <description>&lt;P&gt;Did you use ‘with EMPTY KEY’ ?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes then you have to replace it – “WITH KEY &amp;lt;name of the non
numeric field&amp;gt;”&lt;/P&gt;&lt;P&gt;For example replace line 18 with line 19:&lt;/P&gt;TYPES:&lt;BR /&gt;  BEGIN OF sty,&lt;BR /&gt;    ch(3) TYPE c,&lt;BR /&gt;    int   TYPE i.&lt;BR /&gt;TYPES:END OF sty .&lt;BR /&gt;TYPES:&lt;BR /&gt;  tty_orig TYPE TABLE OF sty&lt;BR /&gt;*  ,tty_sum TYPE TABLE OF sty with EMPTY KEY.   "line 18&lt;BR /&gt;  ,tty_sum TYPE TABLE OF sty WITH KEY ch .      "line 19&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DATA: lt_orig TYPE  tty_orig&lt;BR /&gt;     ,ls_orig LIKE LINE OF lt_orig&lt;BR /&gt;     ,lt_sum TYPE tty_sum&lt;BR /&gt;     .&lt;BR /&gt;&lt;BR /&gt;ls_orig-ch = 'a'.&lt;BR /&gt;ls_orig-int = 1.&lt;BR /&gt;APPEND ls_orig TO lt_orig.&lt;BR /&gt;&lt;BR /&gt;ls_orig-ch = 'a'.&lt;BR /&gt;ls_orig-int = 3.&lt;BR /&gt;APPEND ls_orig TO lt_orig.&lt;BR /&gt;&lt;BR /&gt;ls_orig-ch = 'b'.&lt;BR /&gt;ls_orig-int = 11.&lt;BR /&gt;APPEND ls_orig TO lt_orig.&lt;BR /&gt;&lt;BR /&gt;ls_orig-ch = 'b'.&lt;BR /&gt;ls_orig-int = 33.&lt;BR /&gt;APPEND ls_orig TO lt_orig.&lt;BR /&gt;&lt;BR /&gt;clear ls_orig.&lt;BR /&gt;LOOP AT lt_orig INTO ls_orig .&lt;BR /&gt;  COLLECT ls_orig INTO lt_sum.&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Aug 2022 13:33:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594889#M2010525</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2022-08-22T13:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement using in report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594890#M2010526</link>
      <description>&lt;P&gt;Ahana,&lt;/P&gt;&lt;P&gt;Please share the structure of your internal table and more details(screen capture etc.) on the error. You might also take help from this answer - &lt;A href="https://answers.sap.com/questions/2880928/use-of-collect-statement.html"&gt;https://answers.sap.com/questions/2880928/use-of-collect-statement.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 09:34:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-using-in-report/m-p/12594890#M2010526</guid>
      <dc:creator>Saswata89</dc:creator>
      <dc:date>2022-08-23T09:34:45Z</dc:date>
    </item>
  </channel>
</rss>

