<?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 How to use reference parameters (BAPI Import Parameters) in SQL statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-reference-parameters-bapi-import-parameters-in-sql-statements/m-p/6826374#M1470808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAP gurus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question on using parameters passed in a custom BAPI in SQL statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sending 2 parameters  TABLENAME, COLUMNNAME into a custom bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the BAPI I need to give an sql command some thing like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from TABLENAME where COLUMNNAME = '100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where TABLENAME and COLUMNAME may vary depend on what parameters are sent while calling this BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even defining an internal table that has the structure of TABLENAME is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following statement 'data: ls_TABLENAME type TABLENAME', which generates error message saying TABLENAME is unknons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any feedback will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Mar 2010 03:15:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-25T03:15:47Z</dc:date>
    <item>
      <title>How to use reference parameters (BAPI Import Parameters) in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-reference-parameters-bapi-import-parameters-in-sql-statements/m-p/6826374#M1470808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear SAP gurus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question on using parameters passed in a custom BAPI in SQL statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sending 2 parameters  TABLENAME, COLUMNNAME into a custom bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the BAPI I need to give an sql command some thing like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from TABLENAME where COLUMNNAME = '100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where TABLENAME and COLUMNAME may vary depend on what parameters are sent while calling this BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even defining an internal table that has the structure of TABLENAME is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following statement 'data: ls_TABLENAME type TABLENAME', which generates error message saying TABLENAME is unknons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any feedback will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 03:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-reference-parameters-bapi-import-parameters-in-sql-statements/m-p/6826374#M1470808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-25T03:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use reference parameters (BAPI Import Parameters) in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-reference-parameters-bapi-import-parameters-in-sql-statements/m-p/6826375#M1470809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know you can not give parameter to a select query like that. You should describe the tablename and the columnname as string type.  Then assign the values to them you want to use in query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: str_table type string.&lt;/P&gt;&lt;P&gt;data: str_column type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from  (str_table)  &lt;STRONG&gt;into  &amp;lt;g_t_table&amp;gt;&lt;/STRONG&gt;  where (str_column)  = '100'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the table name is not determined until runtime, you must specify an output area with INTO .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 13:22:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-reference-parameters-bapi-import-parameters-in-sql-statements/m-p/6826375#M1470809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-25T13:22:42Z</dc:date>
    </item>
  </channel>
</rss>

