<?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: What this SQL statement is doing? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267677#M1830831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 table in this select query&lt;/P&gt;&lt;P&gt;1. &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 refered as tb1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;2.&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER refered as tb2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Select query will compare each row of table &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 with each row of &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER to find all pairs of row based on the JOIN condition. (i.e. tbl1~field1 = tbl2~field1 AND tbl1~field2 = tbl2~field2). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Inner join will create a new table by combing the values of both the table based above mentioned condition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;But not all entries are copied to internal table gt_itab. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;The no.of entries is restricted for the entries present in SOURCE_PACKAGE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Later the entries which match the fields in WHERE caluse are copied to gt_itab.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;You can refer to &lt;A href="http://www.tutorialspoint.com/sql/sql-inner-joins.htm" title="http://www.tutorialspoint.com/sql/sql-inner-joins.htm"&gt;SQL - INNER JOINS &lt;BR /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to know more about inner joins. Usually FOR ALL ENTRIES clause in SELECT is used to avoid JOINS since it consumes a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vedanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 May 2014 09:21:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-05-28T09:21:02Z</dc:date>
    <item>
      <title>What this SQL statement is doing?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267674#M1830828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAPers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help me in understanding what the below SQL statement is doing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SELECT * FROM /BIC/ADSO00 AS tb1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN /BIC/PMASTER as tbl2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON tbl1~field1 = tbl2~field1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl12~field2 = tbl2~field2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO CORRESPONDING FIELDS OF TABLE gt_itab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR ALL ENTRIES IN SOURCE_PACKAGE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE tbl1~field3 = SOURCE_PACKAGE-field3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field4 BETWEEN lv_minper AND lv_maxper&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field5 = SOURCE_PACKAGE-field5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field6 = '0100'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl2~OBJVERS = 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bharath S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 May 2014 17:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267674#M1830828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-11T17:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: What this SQL statement is doing?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267675#M1830829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;tb1 is your &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 table &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;tbl2&lt;/SPAN&gt; is your&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px;"&gt; /BIC/PMASTER second table.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;It is selecting all contents from &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 table available and is selecting respective contents from &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER second table&lt;/SPAN&gt; using field 1 and field2 as key(unique in two tables) and moving into an internal table(structures used in program for holding values similar to DB and can hold values till program execution ends) and selection is valid only for entries in source_package another internal table.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Conditions for the selections are &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt; tbl1~field3 = SOURCE_PACKAGE-field3&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field4 BETWEEN lv_minper AND lv_maxper&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field5 = SOURCE_PACKAGE-field5&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field6 = '0100'&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl2~OBJVERS = 'A'.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;Hope it will be helpful.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;Kannan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 May 2014 18:13:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267675#M1830829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-11T18:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: What this SQL statement is doing?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267676#M1830830</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;you are selecting two tables, the system will try to fetch records from anyone of the tables(basically CBO will decide which table will be select first and get the row id then will go into another table which will use primary index along with FAE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can get execution plan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Activate trace&lt;/P&gt;&lt;P&gt;2. Run your program&lt;/P&gt;&lt;P&gt;3. Deactivate your trace&lt;/P&gt;&lt;P&gt;4. Display trace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt;Click execution/explain plan. here we can see the order of select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this would be useful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vadamalai A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 06:45:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267676#M1830830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-15T06:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: What this SQL statement is doing?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267677#M1830831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 table in this select query&lt;/P&gt;&lt;P&gt;1. &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 refered as tb1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;2.&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER refered as tb2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Select query will compare each row of table &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00 with each row of &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER to find all pairs of row based on the JOIN condition. (i.e. tbl1~field1 = tbl2~field1 AND tbl1~field2 = tbl2~field2). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Inner join will create a new table by combing the values of both the table based above mentioned condition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;But not all entries are copied to internal table gt_itab. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;The no.of entries is restricted for the entries present in SOURCE_PACKAGE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Later the entries which match the fields in WHERE caluse are copied to gt_itab.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;You can refer to &lt;A href="http://www.tutorialspoint.com/sql/sql-inner-joins.htm" title="http://www.tutorialspoint.com/sql/sql-inner-joins.htm"&gt;SQL - INNER JOINS &lt;BR /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to know more about inner joins. Usually FOR ALL ENTRIES clause in SELECT is used to avoid JOINS since it consumes a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vedanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2014 09:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267677#M1830831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-28T09:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: What this SQL statement is doing?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267678#M1830832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay Bharath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tb1 and tb2 are the aliases created for tables &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00&lt;/SPAN&gt; and &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/PMASTER&lt;/SPAN&gt; respectively.&lt;/P&gt;&lt;P&gt;In the Select statement, you are fetching all the data from these two tables based on the join conditions i.e. &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tbl1~field1 = tbl2~field1 (Note tb1~field1 means &lt;SPAN style="color: #333333; font-size: 12px;"&gt;/BIC/ADSO00&lt;/SPAN&gt;-field1 and the rest follow similarly)&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;AND tbl12~field2 = tbl2~field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you are placing this data into an internal table. &lt;/P&gt;&lt;P&gt;This select you are performing only for the records that you are getting from SOURCE_PACKAGE based on the selection conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tbl1~field3 = SOURCE_PACKAGE-field3&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field4 BETWEEN lv_minper AND lv_maxper&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field5 = SOURCE_PACKAGE-field5&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl1~field6 = '0100'&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND tbl2~OBJVERS = 'A'.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;Hope it helps !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 09:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-this-sql-statement-is-doing/m-p/10267678#M1830832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-11T09:04:30Z</dc:date>
    </item>
  </channel>
</rss>

