<?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: Want to create dynamic SQL with table join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859407#M362970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GO THROUGH THIS LINK,i hope this ll help you to solve your problem&lt;/P&gt;&lt;P&gt;/people/ravishankar.rajan/blog/2006/12/21/building-dynamic-sql-statements-using-the-clrswhere-class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jan 2007 17:42:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-30T17:42:09Z</dc:date>
    <item>
      <title>Want to create dynamic SQL with table join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859403#M362966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create a dynamic SQL query so that the user can enter any two table names on the selection screen and two field names that he wants to join. After which i should be able to dynamically generate the SQL (native or open) and show the result as report. I have already read the forum threads and know how to create dynamic SQL for single table, what i m struggling with is how to do inner join. I know i can use nested select but that will make the query very slow because i want to extend it to more than 2 tables later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will give points to useful answer for sure, thanks for reading.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2007 23:23:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859403#M362966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-29T23:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create dynamic SQL with table join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859404#M362967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should read my weblog to get an idea -:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/alvaro.tejadagalindo/blog/2006/12/13/dynamic-inner-join-function-module Inner Join Function Module&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 00:52:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859404#M362967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T00:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create dynamic SQL with table join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859405#M362968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Following is a piece of code which I have used in my program.&lt;/P&gt;&lt;P&gt;DATA: ws_flds(72)   TYPE c.&lt;/P&gt;&lt;P&gt;DATA: ftab  LIKE TABLE OF ws_flds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ws_flds = 'rbukrs rprctr racct ryear '.&lt;/P&gt;&lt;P&gt;  APPEND ws_flds TO ftab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   SELECT (ftab)&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE it_grp_glpca&lt;/P&gt;&lt;P&gt;    FROM glpca FOR ALL ENTRIES IN i_cert_item&lt;/P&gt;&lt;P&gt;    WHERE kokrs = c_kokrs&lt;/P&gt;&lt;P&gt;        AND rldnr = '8A'&lt;/P&gt;&lt;P&gt;        AND rrcty IN ('0','2')&lt;/P&gt;&lt;P&gt;        AND rvers  = '000'&lt;/P&gt;&lt;P&gt;        AND rbukrs = i_cert_item-bukrs&lt;/P&gt;&lt;P&gt;        AND ryear  = p_ryear&lt;/P&gt;&lt;P&gt;        AND rprctr = i_cert_item-prctr&lt;/P&gt;&lt;P&gt;        AND racct  = i_cert_item-saknr&lt;/P&gt;&lt;P&gt;        AND ( poper BETWEEN '001' AND ws_poper )&lt;/P&gt;&lt;P&gt;        AND aufnr IN s_aufnr&lt;/P&gt;&lt;P&gt;        AND kostl IN s_kostl&lt;/P&gt;&lt;P&gt;        AND rfarea IN s_fkber&lt;/P&gt;&lt;P&gt;        AND rmvct IN s_rmvct&lt;/P&gt;&lt;P&gt;        AND sprctr IN s_sprctr&lt;/P&gt;&lt;P&gt;        AND ( racct BETWEEN c_low AND c_high ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can now pass your table name as (p_table) or append fieldnames to the internal table (ftab). if it is join then you can append this table like a&lt;SUB&gt;bukrs a&lt;/SUB&gt;saknr..etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 00:53:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859405#M362968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T00:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create dynamic SQL with table join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859406#M362969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alvaro,&lt;/P&gt;&lt;P&gt;  Your function module seems really useful. But when i put in the table names as &lt;/P&gt;&lt;P&gt;VBAK and VBAP, filter table entries as vbeln and posnr and where_table as VBELN EQ '1500000267'.&lt;/P&gt;&lt;P&gt;  I get a runtime error "LOAD_PROGRAM_NOT_FOUND" on line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;005500     if r_oo_class is initial.                              &lt;/P&gt;&lt;P&gt;005510       perform (l_form) in program (l_name).                &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;&amp;gt;    else.                                                  &lt;/P&gt;&lt;P&gt;005530       perform (l_form) in program (l_name) using r_oo_class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;of include LSKBHF06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried hard to figure out the problem but cant, could you please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 17:16:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859406#M362969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T17:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Want to create dynamic SQL with table join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859407#M362970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GO THROUGH THIS LINK,i hope this ll help you to solve your problem&lt;/P&gt;&lt;P&gt;/people/ravishankar.rajan/blog/2006/12/21/building-dynamic-sql-statements-using-the-clrswhere-class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 17:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/want-to-create-dynamic-sql-with-table-join/m-p/1859407#M362970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T17:42:09Z</dc:date>
    </item>
  </channel>
</rss>

