<?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/7767384#M1584222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case you can't  change the database design of your Z-tables, performance seems not to play a big role. The LIKE-syntax would have been '%nnnn" - your dynamic part is in the beginning. But this is a full table scan -&amp;gt; you can select all fields of table 1 yourself and check the match in your coding. That's slow, it would be better to think about a change of the Z-table design (or filling: take proj in the beginning of aennr).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Apr 2011 10:12:36 GMT</pubDate>
    <dc:creator>christian_wohlfahrt</dc:creator>
    <dc:date>2011-04-12T10:12:36Z</dc:date>
    <item>
      <title>Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767381#M1584219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Heloo Everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Z_table1 , in this table the key field is aennr, &lt;/P&gt;&lt;P&gt;Now I want to hit this table for all the entries in an another Z_table2, But the WHERE condition is some what as below.&lt;/P&gt;&lt;P&gt;AENNR+8(4) EQ  i_tab2-filed.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;      FROM z_table1  INTO TABLE i_ztab&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN i_ztab2&lt;/P&gt;&lt;P&gt;      WHERE aennr EQ i_ztab2-proj &lt;/P&gt;&lt;P&gt;In  the above code AENNR+8(4)  EQ  i_tab2-filed i.e last four characters of AENNR  should be equal to i_ztab2-proj .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried appending % to the field PROJ and tried usoing LIKE i.e&lt;/P&gt;&lt;P&gt;WHERE aennr   LIKE  i_ztab2-proj &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 09:43:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767381#M1584219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-12T09:43: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/7767382#M1584220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In declaration of i_ztab1, instead of field AENNR, declare 2 fields(AENNR of length 8 and AENNR_1 of length 4), rest declaration of this is same.&lt;/P&gt;&lt;P&gt;Now, do the other way around. Select from Z_TABLE1 first and then Z_TABLE2 that is:&lt;/P&gt;&lt;P&gt;Select * from Z_table1 into i_ztab1.&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;SELECT * FROM z_table2 INTO TABLE i_ztab2&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_ztab1&lt;/P&gt;&lt;P&gt;WHERE proj EQ i_ztab1-AENNR_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defnitely it'll work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Munish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 10:05:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767382#M1584220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-12T10:05: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/7767383#M1584221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try appending % in both sides of PROJ and then use LIKE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 10:10:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767383#M1584221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-12T10:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767384#M1584222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case you can't  change the database design of your Z-tables, performance seems not to play a big role. The LIKE-syntax would have been '%nnnn" - your dynamic part is in the beginning. But this is a full table scan -&amp;gt; you can select all fields of table 1 yourself and check the match in your coding. That's slow, it would be better to think about a change of the Z-table design (or filling: take proj in the beginning of aennr).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 10:12:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767384#M1584222</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2011-04-12T10:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767385#M1584223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the below given logic...this dynamic select using wild char serach is very slow in terms of performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will not give correct results for the scenariors like BEIGIN WITH ,ENDS WITH ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;..
SELECT *
FROM z_table1 INTO TABLE i_ztab
FOR ALL ENTRIES IN i_ztab2
WHERE aennr like '%XXXX'.
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nagarjuna Sreerambhatla on Apr 12, 2011 4:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 10:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/7767385#M1584223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-12T10:39:27Z</dc:date>
    </item>
  </channel>
</rss>

