<?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: Select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993906#M707188</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;It should be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U should declare a work area not internal table like &lt;/P&gt;&lt;P&gt;data : it_t158b like T158B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single * FROM T158B&lt;/P&gt;&lt;P&gt;into it_t158b WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;AND BWART = 261. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vasudha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vasudha L&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vasudha L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2007 04:19:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-07T04:19:45Z</dc:date>
    <item>
      <title>Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993905#M707187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used following select statemenet and I ma getting this error, &amp;lt;b&amp;gt;The work area "IT_T158B" is not long enough .&amp;lt;/b&amp;gt;can you please tell me what is the problem :&lt;/P&gt;&lt;P&gt;data : begin of it_t158b occurs 0,&lt;/P&gt;&lt;P&gt;           tcode like t158b-tcode,&lt;/P&gt;&lt;P&gt;           bwart like t158b-bwart,&lt;/P&gt;&lt;P&gt;        end of it_t158b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT single * FROM T158B&lt;/P&gt;&lt;P&gt;  into it_t158b WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;  AND BWART = 261.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:18:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993905#M707187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993906#M707188</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;It should be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U should declare a work area not internal table like &lt;/P&gt;&lt;P&gt;data : it_t158b like T158B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single * FROM T158B&lt;/P&gt;&lt;P&gt;into it_t158b WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;AND BWART = 261. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vasudha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vasudha L&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vasudha L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:19:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993906#M707188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993907#M707189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;structure miss match&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_t158b occurs 0,&lt;/P&gt;&lt;P&gt;tcode like t158b-tcode,&lt;/P&gt;&lt;P&gt;bwart like t158b-bwart,&lt;/P&gt;&lt;P&gt;end of it_t158b.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;this correct one&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SELECT single tcode bwart  FROM T158B&lt;/P&gt;&lt;P&gt;into it_t158b WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;AND BWART = 261.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993907#M707189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993908#M707190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using single * you can not use into table&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : IS_T158B type T158B.
SELECT single * FROM T158B
into IS_t158b WHERE TCODE = MIGO
AND BWART = 261.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:21:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993908#M707190</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-11-07T04:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993909#M707191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI thanks for the reply but now i am getting this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Field "TABLE" is unknown. It is neither in one of the specified tables	&amp;lt;/b&amp;gt;	&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;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:22:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993909#M707191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993910#M707192</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 it as a work area as i have edited and in the declaration part of ur prgram add this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: T158B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Vasudha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vasudha L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993910#M707192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993911#M707193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code and I hope it will work 4 u...&lt;/P&gt;&lt;P&gt;reward points if helpful....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_t158b occurs 0,&lt;/P&gt;&lt;P&gt;tcode like t158b-tcode,&lt;/P&gt;&lt;P&gt;bwart like t158b-bwart,&lt;/P&gt;&lt;P&gt;end of it_t158b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single tcode bwart FROM T158B&lt;/P&gt;&lt;P&gt;into it_t158b WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;AND BWART = 261. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 04:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993911#M707193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T04:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993912#M707194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete the occurs 0 statement from data declaration&lt;/P&gt;&lt;P&gt;Change the code to the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of wa_t158b,&lt;/P&gt;&lt;P&gt;tcode type t158b-tcode,&lt;/P&gt;&lt;P&gt;bwart type t158b-bwart,&lt;/P&gt;&lt;P&gt;end of wa_t158b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE tcode bwart&lt;/P&gt;&lt;P&gt;                FROM T158B&lt;/P&gt;&lt;P&gt;                  INTO wa_t158b&lt;/P&gt;&lt;P&gt;             WHERE TCODE = MIGO&lt;/P&gt;&lt;P&gt;                  AND BWART = 261. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first error occurs because you use "*" in the select clause, it will cause all fields to be selected, while the structure you defined only containes two fields which is TCODE and BWART. The structure and what is selected must match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second error, since you are using select single, which is only going to result in one record, you cannot put the result in a table, simply put it in a structure by omitting the "TABLE" from your select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2007 05:01:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2993912#M707194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-07T05:01:59Z</dc:date>
    </item>
  </channel>
</rss>

