<?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: Dynamic table declaration in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999027#M708489</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;take care that table name should be defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: tabname type dd08v-tabname Value 'MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from (tabname) into table itab where x = y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Nov 2007 10:37:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-05T10:37:49Z</dc:date>
    <item>
      <title>Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999026#M708488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to accept a filename from user and display its contents.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters:tabname(15) type c.
data wa type ZGTABLE. *I dont know how to declare a variable of table type which user enters.
select * from (TABNAME) into wa. *Dynamic declaration
write wa.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is coming,but I have hardcoded 'Data wa type zgtable' ie if user enters table otherthan zgtable it gives undesired ouput.I need to declare wa type as table type which user enters.Hope you understood my question.Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 10:31:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999026#M708488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T10:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999027#M708489</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;take care that table name should be defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: tabname type dd08v-tabname Value 'MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from (tabname) into table itab where x = y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 10:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999027#M708489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T10:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999028#M708490</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;Try this piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YDEMO .&lt;/P&gt;&lt;P&gt;PARAMETERS: TBLNAME(50). "DEFAULT 'SPFLI'.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_ROWS TYPE P.&lt;/P&gt;&lt;P&gt;SELECT COUNT(*) FROM (TBLNAME) INTO TOTAL_ROWS. &lt;/P&gt;&lt;P&gt;WRITE: / TBLNAME, TOTAL_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vasudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 10:38:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999028#M708490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T10:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999029#M708491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this blog by Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap:///people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 10:39:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999029#M708491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T10:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999030#M708492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gopi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Field symbols then. Or refer below thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/ab030.htm" target="test_blank"&gt;http://www.sap-img.com/ab030.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.sdn.sap.com/wiki/display/Snippets/Dynamic" target="test_blank"&gt;https://wiki.sdn.sap.com/wiki/display/Snippets/Dynamic&lt;/A&gt;&lt;EM&gt;Internal&lt;/EM&gt;Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 10:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999030#M708492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T10:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999031#M708493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys for your replies.I tried your ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Naresh:Itab is not declared.How do you declare it now?we dont the structure of the table which user is going to input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasudha : Your code displays number of total rows in the given table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reminder:If user enters zgtable,zgtable contents should be displayed.If zgtable1 is entered,its conents should be displayed.This is how it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any more help..Please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2007 12:01:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-select-statement/m-p/2999031#M708493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-05T12:01:05Z</dc:date>
    </item>
  </channel>
</rss>

