<?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 Concatenate problem for Dynamic SQL statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-problem-for-dynamic-sql-statements/m-p/4434488#M1052525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am building Dynamic SQL statements depending on the values which the user enters into the select option parameters .This dynamic query is passed to cl_sql_connection object for querying from another databasse&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i wrote dynamic values for one select option spointof for the database field ppointofdelivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at spointof.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE ' pointofdelivery between ''' spointof-low''''&lt;/P&gt;&lt;P&gt;' AND ''' spointof-high''''&lt;/P&gt;&lt;P&gt;INTO where_clause .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whereclause has value &lt;STRONG&gt;pointofdelivery between '123' and '124'&lt;/STRONG&gt;.(if the user has entered 123 and 124 as values)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine . But my problem is I have to pass the fieldnames and operator dynamically into where_clause depending on User input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am writing code like the below&lt;/P&gt;&lt;P&gt;field_name = ' pointofdelivery '.&lt;/P&gt;&lt;P&gt;operator = '='.&lt;/P&gt;&lt;P&gt;CONCATENATE field_name operator '''spointof-low''' INTO where_clause .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the where_clause contains value &lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;pointofdelivery = ' spointof-low '&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and not &lt;STRONG&gt;pointofdelivery = ' 123&lt;/STRONG&gt; ' as expected . &lt;/P&gt;&lt;P&gt;Do you know why this is haapening as it is not taking the value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Sep 2008 17:12:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-04T17:12:42Z</dc:date>
    <item>
      <title>Concatenate problem for Dynamic SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-problem-for-dynamic-sql-statements/m-p/4434488#M1052525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am building Dynamic SQL statements depending on the values which the user enters into the select option parameters .This dynamic query is passed to cl_sql_connection object for querying from another databasse&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i wrote dynamic values for one select option spointof for the database field ppointofdelivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at spointof.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE ' pointofdelivery between ''' spointof-low''''&lt;/P&gt;&lt;P&gt;' AND ''' spointof-high''''&lt;/P&gt;&lt;P&gt;INTO where_clause .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whereclause has value &lt;STRONG&gt;pointofdelivery between '123' and '124'&lt;/STRONG&gt;.(if the user has entered 123 and 124 as values)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine . But my problem is I have to pass the fieldnames and operator dynamically into where_clause depending on User input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am writing code like the below&lt;/P&gt;&lt;P&gt;field_name = ' pointofdelivery '.&lt;/P&gt;&lt;P&gt;operator = '='.&lt;/P&gt;&lt;P&gt;CONCATENATE field_name operator '''spointof-low''' INTO where_clause .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the where_clause contains value &lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;pointofdelivery = ' spointof-low '&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and not &lt;STRONG&gt;pointofdelivery = ' 123&lt;/STRONG&gt; ' as expected . &lt;/P&gt;&lt;P&gt;Do you know why this is haapening as it is not taking the value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 17:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-problem-for-dynamic-sql-statements/m-p/4434488#M1052525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T17:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate problem for Dynamic SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-problem-for-dynamic-sql-statements/m-p/4434489#M1052526</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;there are lot of function modules..available...to build a where clause based on the select-options..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the FM FREE_SELECTIONS_RANGE_2_WHERE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 17:20:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concatenate-problem-for-dynamic-sql-statements/m-p/4434489#M1052526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T17:20:21Z</dc:date>
    </item>
  </channel>
</rss>

