<?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 select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564803#M1077311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot but it doesn't work in my case because if I have the same table I said before but I have this values in condition tab&lt;/P&gt;&lt;P&gt;field1 = B and field2 = B, my select would return group1 and it should not return any value...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2008 10:34:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-08T10:34:02Z</dc:date>
    <item>
      <title>Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564799#M1077307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am doing a select with a dynamic where condition but I only need to check a field value in database table if there is an entry. Is there any way to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example I have this DB table:&lt;/P&gt;&lt;P&gt;Group  field   value&lt;/P&gt;&lt;P&gt;1         field1  A&lt;/P&gt;&lt;P&gt;1         field2  B&lt;/P&gt;&lt;P&gt;2         field3  C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get the 'Group field' and imagine that, in my condition tab for select, I have for example that field1 = B and field3 = C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, I need that select  returns 'group 2', as for group 1 field1 is different from my field1 value and group2 does not care about the value of field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it would be great that I could say in the where condition tab  to check the field value only if in DB table the entry exists...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:14:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564799#M1077307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564800#M1077308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is possible that you can use a string to be your where clause in the selection statement. That means you can make a dynamic where clause according to the data by concatentate. I am sorry that my answer is not specific enough but hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached with the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM Select_Data_ByType using type_string.
  Data: where_clause type string Value 'where ',
        replace_offset type i.
  if type_string+0(1) = '1'.
    Concatenate where_clause 'type = Y AND' INTO where_clause separated by ' '.
  endif.
  if type_string+1(1) = '1'.
    Concatenate where_clause 'type = N AND ' INTO where_clause separated by ' '.
  endif.
  if type_string+2(1) = '1'.
    Concatenate where_clause 'type = NA AND ' INTO where_clause separated by ' '.
  endif.
  replace_offset = strlen( where_clause ) - 4.
  replace section offset replace_offset of where_clause with ''.
  write where_clause.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Leon Law on Oct 8, 2008 6:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:21:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564800#M1077308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564801#M1077309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Leon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am already using a string for my dynamic where condition, but I need to know if I can say in the string not to compare a field if threre is no entry in the BD table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway for your answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:27:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564801#M1077309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564802#M1077310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the OR operator instead of the AND operator, i.e. select from table where field1 = B &lt;STRONG&gt;or&lt;/STRONG&gt; field3 = C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564802#M1077310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564803#M1077311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot but it doesn't work in my case because if I have the same table I said before but I have this values in condition tab&lt;/P&gt;&lt;P&gt;field1 = B and field2 = B, my select would return group1 and it should not return any value...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564803#M1077311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564804#M1077312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see, I had misunderstood your scenario.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:38:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564804#M1077312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564805#M1077313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to avoid to do a loop inside a select but I am afraid I will have to do it..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564805#M1077313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564806#M1077314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think so. If my understanding is correct, you need to retrieve all the data first before checking if the data really exist in the database. From my knowledge (I am new to ABAP...), it seems there is no way to check the existence of a value without accessing the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/4564806#M1077314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T10:48:54Z</dc:date>
    </item>
  </channel>
</rss>

