<?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 data from multiple tables using only one select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699997#M31775</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;you can write something like this 

SELECT * FROM (p_table) INTO TABLE @DATA(lt_table) UP TO p_rows ROWS.

*lt_table will be dynamically created based on select output. &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 17 Dec 2018 16:12:12 GMT</pubDate>
    <dc:creator>s1252</dc:creator>
    <dc:date>2018-12-17T16:12:12Z</dc:date>
    <item>
      <title>Select data from multiple tables using only one select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699995#M31773</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I am making a report where the user chooses the names of tables he wants to select data from. I have to fetch data from these tables and upload the data as flat files to application server.&lt;/P&gt;
  &lt;P&gt;When writing the report, 2 things are unknown : name and number of tables. As the internal table also depends on the table, the structure will be unknown too.&lt;/P&gt;
  &lt;P&gt;Is there a way in which I can only write one select statement and it can be reused.&lt;/P&gt;
  &lt;P&gt;Something like:&lt;/P&gt;
  &lt;P&gt;Select * from [table name] into table [internal table name of same format].&lt;/P&gt;
  &lt;P&gt;where I can update the table name and internal table (which should be of the same format as the table) .&lt;/P&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;Samriddhi&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 07:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699995#M31773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-12-17T07:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select data from multiple tables using only one select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699996#M31774</link>
      <description>&lt;P&gt;Take a look at program: DEMO_DYNAMIC_SQL, you will know how to build a dynamic SQL.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 08:44:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699996#M31774</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-12-17T08:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select data from multiple tables using only one select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699997#M31775</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;you can write something like this 

SELECT * FROM (p_table) INTO TABLE @DATA(lt_table) UP TO p_rows ROWS.

*lt_table will be dynamically created based on select output. &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Dec 2018 16:12:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-data-from-multiple-tables-using-only-one-select-query/m-p/699997#M31775</guid>
      <dc:creator>s1252</dc:creator>
      <dc:date>2018-12-17T16:12:12Z</dc:date>
    </item>
  </channel>
</rss>

