<?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 field in select statment. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778457#M1307943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if this works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;G_CHBFLD = 'K~EBELN IN S_EBELN AND K~AEDAT IN S_AEDAT
AND K~BSTYP IN S_BSTYPP AND P~BANFN = space'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2009 12:40:23 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-06-22T12:40:23Z</dc:date>
    <item>
      <title>Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778449#M1307935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a report in which i have two checkboxes in the selection screen. The first checkbox is for the option to bring or not, initial purchase requisitions (BANFN) from EKPO and the second is to bring initial or not, RFQs&lt;/P&gt;&lt;P&gt;(ANFNR). I want the select statment to have this form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ekpo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into g_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;STRONG&gt;dynamic field&lt;/STRONG&gt; = " ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried to put it as a string but it didnt work. (data: dynamic field type string value "EKPO-BANFN")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S i know that it can be by writing the same select code twice. &lt;/P&gt;&lt;P&gt;I just wonder if this can be done by this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 11:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778449#M1307935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T11:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778450#M1307936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can have a dynamic where clause for your select statement.&lt;/P&gt;&lt;P&gt;Do F1 on SELECT and see the documentation under  "WHERE - (cond_syntax)" &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;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 11:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778450#M1307936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T11:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778451#M1307937</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;You can create the WHERE clause a a variable and construct it based on the selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your statement becomes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ekpo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into g_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE (lv_where_clause).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable lv_where_clause contains "FIELD1 = v_1 AND FIELD2 = v_2" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 11:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778451#M1307937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T11:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778452#M1307938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778452#M1307938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778453#M1307939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Nick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have more conditions than the one i said before , should all be in the lv_where_clause ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check my code.&lt;/P&gt;&lt;P&gt;*************************************&lt;/P&gt;&lt;P&gt;DATA: G_CHBFLD type STRING.&lt;/P&gt;&lt;P&gt;G_CHBFLD = 'P~BANFN = '' " '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM SELECT_DATA_EKPO_EKKO.&lt;/P&gt;&lt;P&gt;  SELECT  .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      FROM EKPO AS P INNER JOIN EKKO AS K&lt;/P&gt;&lt;P&gt;        ON P&lt;SUB&gt;EBELN = K&lt;/SUB&gt;EBELN&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF TABLE GT_EKPOEKKO&lt;/P&gt;&lt;P&gt;            WHERE K~EBELN IN S_EBELN&lt;/P&gt;&lt;P&gt;            AND K~AEDAT IN S_AEDAT&lt;/P&gt;&lt;P&gt;            AND K~BSTYP IN S_BSTYP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            and ( G_CHBFLD ) .   -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&amp;gt; //DEBUGER ")" is not a valid comparison operator. comparison operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="38" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778453#M1307939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778454#M1307940</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 putting the whole WHERE clause in the variable,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G_CHBFLD = 'K&lt;SUB&gt;EBELN IN S_EBELN AND K&lt;/SUB&gt;AEDAT IN S_AEDAT&lt;/P&gt;&lt;P&gt;AND K&lt;SUB&gt;BSTYP IN S_BSTYPP AND 'P&lt;/SUB&gt;BANFN = '' " '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;FROM EKPO AS P INNER JOIN EKKO AS K&lt;/P&gt;&lt;P&gt;ON P&lt;SUB&gt;EBELN = K&lt;/SUB&gt;EBELN&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE GT_EKPOEKKO&lt;/P&gt;&lt;P&gt;WHERE (G_CHBFLD) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778454#M1307940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778455#M1307941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WORKS for the debbuger, but it occurs a runtime error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************&lt;/P&gt;&lt;P&gt;An exception occurred. This exception is dealt with in more detail below&lt;/P&gt;&lt;P&gt;. The exception, which is assigned to the class 'CX_SY_DYNAMIC_OSQL_SYNTAX',&lt;/P&gt;&lt;P&gt; was neither&lt;/P&gt;&lt;P&gt;caught nor passed along using a RAISING clause, in the procedure&lt;/P&gt;&lt;P&gt; "SELECT_DATA_EKPO_EKKO" "(FORM)"&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Since the caller of the procedure could not have expected this exception&lt;/P&gt;&lt;P&gt; to occur, the running program was terminated.&lt;/P&gt;&lt;P&gt;The reason for the exception is:&lt;/P&gt;&lt;P&gt;The current ABAP program attempted to execute an Open SQL&lt;/P&gt;&lt;P&gt;statement containing a WHERE condition of the form WHERE (itab) or&lt;/P&gt;&lt;P&gt;WHERE ... AND (itab). The part of the WHERE condition specified at&lt;/P&gt;&lt;P&gt;runtime in the internal table itab contains a literal&lt;/P&gt;&lt;P&gt;"'" that begins with "'", but has no closing "'".&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="32" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778455#M1307941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778456#M1307942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check your dynamic where clause.&lt;/P&gt;&lt;P&gt;Maybe you have not closed the literals with proper quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778456#M1307942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778457#M1307943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if this works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;G_CHBFLD = 'K~EBELN IN S_EBELN AND K~AEDAT IN S_AEDAT
AND K~BSTYP IN S_BSTYPP AND P~BANFN = space'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:40:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778457#M1307943</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-06-22T12:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field in select statment.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778458#M1307944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;space works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thk you all for your replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 12:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-in-select-statment/m-p/5778458#M1307944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T12:48:15Z</dc:date>
    </item>
  </channel>
</rss>

