<?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/3286013#M786002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Goldie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields mentioned after the SELECT and before INTO are the fields that this SELECT statement will select from the database tables mentioned before the &lt;EM&gt;&lt;STRONG&gt;tilde&lt;/STRONG&gt;&lt;/EM&gt; e.g. &lt;STRONG&gt;LIKP&lt;/STRONG&gt;~VESTL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields mentioned after INTO and before FROM are the fields of the structures whose name is mentioned before &lt;EM&gt;&lt;STRONG&gt;hyphen&lt;/STRONG&gt;&lt;/EM&gt; e.g. &lt;STRONG&gt;LIKP&lt;/STRONG&gt; -VESTL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this statement to work, you need TABLES statment for all the structure names mentioned in the INTO addition. You also need an ENDSELECT statement which is not mentioned in your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structures are program data objects where the SELECT statement will put the values after selecting them from the database tables in each loop pass of the SELECT...ENDSELECT loop and &lt;EM&gt;there is nothing like putting them back in the database tables as you mentioned&lt;/EM&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The confusion is created by the same name for a database table and its corresponding structure created by TABLES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just FYI, TABLES statement is obsolete in ABAP Objects context, so try not to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sanjeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2008 17:55:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-14T17:55:15Z</dc:date>
    <item>
      <title>select statement!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286011#M786000</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;can anyone please tell me how this select statement works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT LIPS&lt;SUB&gt;LFIMG LIPS&lt;/SUB&gt;MATNR LIPS&lt;SUB&gt;VBELN LIPS&lt;/SUB&gt;VRKME LIKP~KUNNR&lt;/P&gt;&lt;P&gt;       LIKP&lt;SUB&gt;LFART LIKP&lt;/SUB&gt;VBELN LIKP&lt;SUB&gt;VSBED LIKP&lt;/SUB&gt;VSTEL LIKP~WADAT_IST&lt;/P&gt;&lt;P&gt;       KNA1~NAME4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  INTO (LIPS-LFIMG , LIPS-MATNR , LIPS-VBELN , LIPS-VRKME , LIKP-KUNNR&lt;/P&gt;&lt;P&gt;     , LIKP-LFART , LIKP-VBELN , LIKP-VSBED , LIKP-VSTEL&lt;/P&gt;&lt;P&gt;     , LIKP-WADAT_IST, KNA1-NAME4 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FROM ( LIPS&lt;/P&gt;&lt;P&gt;       INNER JOIN LIKP&lt;/P&gt;&lt;P&gt;       ON LIKP&lt;SUB&gt;VBELN = LIPS&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;       INNER JOIN KNA1&lt;/P&gt;&lt;P&gt;       ON KNA1&lt;SUB&gt;KUNNR = LIKP&lt;/SUB&gt;KUNNR )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I dont understand is we are selecting some fields and then putting them back in the same fields of the same table? why would we do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;goldie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 17:35:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286011#M786000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T17:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: select statement!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286012#M786001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to check the Help Files under Data Declarations (Work Areas orBuffers).  You can see your answer there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 17:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286012#M786001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T17:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: select statement!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286013#M786002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Goldie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields mentioned after the SELECT and before INTO are the fields that this SELECT statement will select from the database tables mentioned before the &lt;EM&gt;&lt;STRONG&gt;tilde&lt;/STRONG&gt;&lt;/EM&gt; e.g. &lt;STRONG&gt;LIKP&lt;/STRONG&gt;~VESTL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields mentioned after INTO and before FROM are the fields of the structures whose name is mentioned before &lt;EM&gt;&lt;STRONG&gt;hyphen&lt;/STRONG&gt;&lt;/EM&gt; e.g. &lt;STRONG&gt;LIKP&lt;/STRONG&gt; -VESTL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this statement to work, you need TABLES statment for all the structure names mentioned in the INTO addition. You also need an ENDSELECT statement which is not mentioned in your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structures are program data objects where the SELECT statement will put the values after selecting them from the database tables in each loop pass of the SELECT...ENDSELECT loop and &lt;EM&gt;there is nothing like putting them back in the database tables as you mentioned&lt;/EM&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The confusion is created by the same name for a database table and its corresponding structure created by TABLES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just FYI, TABLES statement is obsolete in ABAP Objects context, so try not to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sanjeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 17:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/3286013#M786002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T17:55:15Z</dc:date>
    </item>
  </channel>
</rss>

