<?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 details in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395967#M533211</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;SELECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;SELECT result &lt;/P&gt;&lt;P&gt;       FROM source &lt;/P&gt;&lt;P&gt;       INTO|APPENDING target &lt;/P&gt;&lt;P&gt;       [[FOR ALL ENTRIES IN itab] WHERE sql_cond] &lt;/P&gt;&lt;P&gt;       &lt;A href="GROUP BY group"&gt;&lt;/A&gt; &lt;A href="HAVING group_cond"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;       &lt;A href="ORDER BY sort_key"&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/ENDSELECT"&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement reads a result set (whose structure is determined in result ) from the database tables specified in source, and assigns the data from the result set to the data objects specified in target. You can restrict the result set using the WHERE addition. The addition GROUP BY compresses several database rows into a single row of the result set. The addition HAVING restricts the compressed rows. The addition ORDER BY sorts the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data objects specified in target must match the result set result. This means that the result set is either assigned to the data objects in one step, or by row, or by packets of rows. In the second and third case, the SELECT statement opens a loop, which which must be closed using ENDSELECT. For every loop pass, the SELECT-statement assigns a row or a packet of rows to the data objects specified in target. If the last row was assigned or if the result set is empty, then SELECT branches to ENDSELECT . A database cursor is opened implicitly to process a SELECT-loop, and is closed again when the loop is ended. You can end the loop using the statements from section leave loops. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Up to the INTO resp. APPENDING addition, the entries in the SELECTstatement define which data should be read by the database in which form. This requirement is translated in the database interface for the database system´s programming interface and is then passed to the database system. The data are read in packets by the database and are transported to the application server by the database server. On the application server, the data are transferred to the ABAP program´s data objects in accordance with the data specified in the INTO and APPENDING additions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: p_cityfr TYPE spfli-cityfrom, 
            p_cityto TYPE spfli-cityto. 

DATA: BEGIN OF wa, 
         fldate TYPE sflight-fldate, 
         carrname TYPE scarr-carrname, 
         connid   TYPE spfli-connid, 
       END OF wa. 

DATA itab LIKE SORTED TABLE OF wa 
               WITH UNIQUE KEY fldate carrname connid. 

SELECT c~carrname p~connid f~fldate 
       INTO CORRESPONDING FIELDS OF TABLE itab 
       FROM ( ( scarr AS c 
         INNER JOIN spfli AS p ON p~carrid   = c~carrid 
                              AND p~cityfrom = p_cityfr 
                              AND p~cityto   = p_cityto ) 
         INNER JOIN sflight AS f ON f~carrid = p~carrid 
                                AND f~connid = p~connid ). 

LOOP AT itab INTO wa. 
  WRITE: / wa-fldate, wa-carrname, wa-connid. 
ENDLOOP. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 11:14:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-11T11:14:36Z</dc:date>
    <item>
      <title>select statement details</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395965#M533209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends, can any one give me the possible select statement which are used in Report query with some code examples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 06:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395965#M533209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T06:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: select statement details</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395966#M533210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;a,Open SQL&lt;/P&gt;&lt;P&gt;b,Native SQL&lt;/P&gt;&lt;P&gt;Open SQL , native SQL are the interfaces to create the database applicatons. &lt;/P&gt;&lt;P&gt;Open SQL is consistant across different types of existing Databases. &lt;/P&gt;&lt;P&gt;Native SQL is the database language specific to database.Its API is specific to the databse&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we r using most of time open SQL only.&lt;/P&gt;&lt;P&gt;Select single&lt;/P&gt;&lt;P&gt;select ipsto n rows&lt;/P&gt;&lt;P&gt;Select * from itab into table tab1 where (some condition)/&lt;/P&gt;&lt;P&gt;and u can jon the table using inner join and outer joins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points if helpfull,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suresh.D&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        suresh dameruppula&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 11:05:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395966#M533210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T11:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: select statement details</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395967#M533211</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;SELECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;SELECT result &lt;/P&gt;&lt;P&gt;       FROM source &lt;/P&gt;&lt;P&gt;       INTO|APPENDING target &lt;/P&gt;&lt;P&gt;       [[FOR ALL ENTRIES IN itab] WHERE sql_cond] &lt;/P&gt;&lt;P&gt;       &lt;A href="GROUP BY group"&gt;&lt;/A&gt; &lt;A href="HAVING group_cond"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;       &lt;A href="ORDER BY sort_key"&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/ENDSELECT"&gt;&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement reads a result set (whose structure is determined in result ) from the database tables specified in source, and assigns the data from the result set to the data objects specified in target. You can restrict the result set using the WHERE addition. The addition GROUP BY compresses several database rows into a single row of the result set. The addition HAVING restricts the compressed rows. The addition ORDER BY sorts the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data objects specified in target must match the result set result. This means that the result set is either assigned to the data objects in one step, or by row, or by packets of rows. In the second and third case, the SELECT statement opens a loop, which which must be closed using ENDSELECT. For every loop pass, the SELECT-statement assigns a row or a packet of rows to the data objects specified in target. If the last row was assigned or if the result set is empty, then SELECT branches to ENDSELECT . A database cursor is opened implicitly to process a SELECT-loop, and is closed again when the loop is ended. You can end the loop using the statements from section leave loops. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Up to the INTO resp. APPENDING addition, the entries in the SELECTstatement define which data should be read by the database in which form. This requirement is translated in the database interface for the database system´s programming interface and is then passed to the database system. The data are read in packets by the database and are transported to the application server by the database server. On the application server, the data are transferred to the ABAP program´s data objects in accordance with the data specified in the INTO and APPENDING additions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: p_cityfr TYPE spfli-cityfrom, 
            p_cityto TYPE spfli-cityto. 

DATA: BEGIN OF wa, 
         fldate TYPE sflight-fldate, 
         carrname TYPE scarr-carrname, 
         connid   TYPE spfli-connid, 
       END OF wa. 

DATA itab LIKE SORTED TABLE OF wa 
               WITH UNIQUE KEY fldate carrname connid. 

SELECT c~carrname p~connid f~fldate 
       INTO CORRESPONDING FIELDS OF TABLE itab 
       FROM ( ( scarr AS c 
         INNER JOIN spfli AS p ON p~carrid   = c~carrid 
                              AND p~cityfrom = p_cityfr 
                              AND p~cityto   = p_cityto ) 
         INNER JOIN sflight AS f ON f~carrid = p~carrid 
                                AND f~connid = p~connid ). 

LOOP AT itab INTO wa. 
  WRITE: / wa-fldate, wa-carrname, wa-connid. 
ENDLOOP. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 11:14:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395967#M533211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T11:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: select statement details</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395968#M533212</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;&amp;lt;b&amp;gt;follow this link&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/62/10a423384746e8bf5f15ccdd36e8b1/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/62/10a423384746e8bf5f15ccdd36e8b1/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;link for  example progam  select statement with innerjoins&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/select-statement-with-inner-join-is-taking-forever.htm" target="test_blank"&gt;http://www.sap-img.com/abap/select-statement-with-inner-join-is-taking-forever.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;link for select statement with for all entries&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/usage-of-for-all-entries-in-select-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/usage-of-for-all-entries-in-select-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;follow this link for sample programs using different types of select statement.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap.htm" target="test_blank"&gt;http://www.sap-img.com/abap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashokreddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 11:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-details/m-p/2395968#M533212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T11:25:12Z</dc:date>
    </item>
  </channel>
</rss>

