<?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: &amp;quot;SELECT&amp;quot; problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523394#M571394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks guys, i found the problem and fixed it. i declared other fields also in the internal table and that turns out to be the reason why the suming doesnt take place properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2007 04:10:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-09T04:10:17Z</dc:date>
    <item>
      <title>"SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523388#M571388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select s012&lt;SUB&gt;matnr sum( s012&lt;/SUB&gt;menge ) sum( s012&lt;SUB&gt;wemgm ) from s012 into corresponding fields of table it1 group by s012&lt;/SUB&gt;matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i am having problem with the query mentioned above.&lt;/P&gt;&lt;P&gt; grouping by matnr is successful but summing of menge and wemge dont take place. &lt;/P&gt;&lt;P&gt; it comes as 0 in these two fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can somebody kindly let me know the right way of summing these two fields grouped by the material?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523388#M571388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523389#M571389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it may be because of into corresponding fields of table declaration...&lt;/P&gt;&lt;P&gt;do like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it1 occurs 0,&lt;/P&gt;&lt;P&gt;matnr  like  s012-matnr,&lt;/P&gt;&lt;P&gt;menge like s012-menge,&lt;/P&gt;&lt;P&gt;wemng like s012-wemgm ,&lt;/P&gt;&lt;P&gt;end of it1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select s012&lt;SUB&gt;matnr sum( s012&lt;/SUB&gt;menge ) sum( s012&lt;SUB&gt;wemgm ) from s012 into table it1 group by s012&lt;/SUB&gt;matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523389#M571389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523390#M571390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of itab1 occurs 0,
matnr like s012-matnr,
menge like s012-menge,
wemng like s012~wemgm ,
end of itab1.

select s012~matnr sum( s012~menge ) sum( s012~wemgm ) from s012 into table itab1 group by s012~matnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523390#M571390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523391#M571391</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;To use the GROUP BY clause, you must specify all of the relevant columns in the SELECT clause. In the GROUP BY clause, you list the field names of the columns whose contents must be the same. You can only use the field names as they appear in the database table. Alias names from the SELECT clause are not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All columns of the SELECT clause that are not listed in the GROUP BY clause must be included in aggregate functions. This defines how the contents of these columns is calculated when the lines are summarized. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to help link for more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srilatha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:32:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523391#M571391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523392#M571392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thers is no data in s012~wemgm. Actually do you want to add that two fields.I am giving code for just display datas, just try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : s012.&lt;/P&gt;&lt;P&gt;data : it1 type table of s012,&lt;/P&gt;&lt;P&gt;       wa type s012.&lt;/P&gt;&lt;P&gt;select * from s012 into table it1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it1 into wa.&lt;/P&gt;&lt;P&gt;write : / wa-matnr,&lt;/P&gt;&lt;P&gt;         wa-menge,&lt;/P&gt;&lt;P&gt;         wa-wemgm.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its useful reward points,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;senthil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:35:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523392#M571392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523393#M571393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF IT1 OCCURS 0,&lt;/P&gt;&lt;P&gt;MATNR LIKE S012-MATNR,&lt;/P&gt;&lt;P&gt;MENGE LIKE S012-MENGE,&lt;/P&gt;&lt;P&gt;WEMNG LIKE S012-WEMGM ,&lt;/P&gt;&lt;P&gt;END OF IT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT S012&lt;SUB&gt;MATNR SUM( S012&lt;/SUB&gt;MENGE ) SUM( S012&lt;SUB&gt;WEMGM ) FROM S012 INTO TABLE IT1 GROUP BY S012&lt;/SUB&gt;MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT1.&lt;/P&gt;&lt;P&gt;  WRITE : / IT1-MATNR,&lt;/P&gt;&lt;P&gt;            IT1-MENGE,&lt;/P&gt;&lt;P&gt;            IT1-WEMNG.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its useful reward points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;senthil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2007 10:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523393#M571393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-07T10:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: "SELECT" problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523394#M571394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks guys, i found the problem and fixed it. i declared other fields also in the internal table and that turns out to be the reason why the suming doesnt take place properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 04:10:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-select-quot-problem/m-p/2523394#M571394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T04:10:17Z</dc:date>
    </item>
  </channel>
</rss>

