<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320820#M509495</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 could try the dynamical SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  For ex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select (itab) from ekko as a inner join ekpo as b&lt;/P&gt;&lt;P&gt;      on a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;      ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  and you could define the itab like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: &lt;/P&gt;&lt;P&gt;     begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       field(30),&lt;/P&gt;&lt;P&gt;      end of itab.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  and add the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field = a~ebeln.&lt;/P&gt;&lt;P&gt;   append field.&lt;/P&gt;&lt;P&gt;   ......&lt;/P&gt;&lt;P&gt;   U can add all of the fields of ekko in the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   And for an enhace, you could get all field of ekko in table dd03l, and take the dd03l fieldname to a internal table, loop this table, concatenate 'a~' dd03l-fieldname into field, append field to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Note that there maybe some .include field in the dd03l, so you should delete this kind of field.&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;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 May 2007 11:13:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-28T11:13:04Z</dc:date>
    <item>
      <title>SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320813#M509488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible write something as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT x.*, y.field1, y.field2&lt;/P&gt;&lt;P&gt;FROM  table1 x, table2 y &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ABAP statement ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want write ALL fields of table table1 and i want only some fields of table table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for advice in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 10:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320813#M509488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T10:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320814#M509489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT coep~MATNR&lt;/P&gt;&lt;P&gt;COEP~WTGBTR&lt;/P&gt;&lt;P&gt;COEP~MEGBTR&lt;/P&gt;&lt;P&gt;COEP~MEINH&lt;/P&gt;&lt;P&gt;COEP~OBJNR&lt;/P&gt;&lt;P&gt;MARA~MTART&lt;/P&gt;&lt;P&gt;FROM COEP INNER JOIN MARA&lt;/P&gt;&lt;P&gt;ON COEP&lt;SUB&gt;MATNR = MARA&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;INTO TABLE IT_RESB&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN IT_CAUFV&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;coep~OBJNR = IT_CAUFV-OBJNR&lt;/P&gt;&lt;P&gt;AND MARA~MTART IN ('YFLM','YCHE','YRAW').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 10:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320814#M509489</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-28T10:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320815#M509490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a view or a join&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 10:56:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320815#M509490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T10:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320816#M509491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can write a inner join and for all entries ..  so for example u can refer to abapdocu.. example will be clear and simple&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 10:59:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320816#M509491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T10:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320817#M509492</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;  Use Joins options or else use FOR ALL ENTRIES options if at all there is any link between these 2 tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mostly preferred is FOR ALL ENTRIES option. Avoid using Joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Haritha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 11:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320817#M509492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T11:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320818#M509493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get ALL fields of the table table1 + 2 fields of the table table2, but i don't want write ALL fields in SQL statement (x.field1, x.field2....x.fieldN, y.field1, y.field2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 11:05:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320818#M509493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T11:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320819#M509494</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;I think it is not possible in select statement the way you wrote,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first get the data from first table&lt;/P&gt;&lt;P&gt;select * from DBtable into itab where &amp;lt;f1&amp;gt; = &amp;lt;s_f1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use for all entries&lt;/P&gt;&lt;P&gt;if itab[] is not initial&lt;/P&gt;&lt;P&gt;select &amp;lt;f1&amp;gt; &amp;lt;f2&amp;gt; ..&lt;/P&gt;&lt;P&gt;        from DBTABLE2 into itab2&lt;/P&gt;&lt;P&gt;        for all entries in itab&lt;/P&gt;&lt;P&gt;        where &amp;lt;f1&amp;gt; = itab-f1 ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this gives you better performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if useful,&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 11:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320819#M509494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T11:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320820#M509495</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 could try the dynamical SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  For ex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select (itab) from ekko as a inner join ekpo as b&lt;/P&gt;&lt;P&gt;      on a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;      ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  and you could define the itab like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: &lt;/P&gt;&lt;P&gt;     begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       field(30),&lt;/P&gt;&lt;P&gt;      end of itab.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  and add the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field = a~ebeln.&lt;/P&gt;&lt;P&gt;   append field.&lt;/P&gt;&lt;P&gt;   ......&lt;/P&gt;&lt;P&gt;   U can add all of the fields of ekko in the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   And for an enhace, you could get all field of ekko in table dd03l, and take the dd03l fieldname to a internal table, loop this table, concatenate 'a~' dd03l-fieldname into field, append field to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Note that there maybe some .include field in the dd03l, so you should delete this kind of field.&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;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 11:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/2320820#M509495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T11:13:04Z</dc:date>
    </item>
  </channel>
</rss>

