<?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 where clause for LOOP AT internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404152#M1241212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; 1. Generally why doesn't a dynamic where for the loop at statement on internal tables work the same as a dynamic where clause for a select on dbtabs? A logical expression is still a logical expression and in both cases it's evaluated at runtime not at compile time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guessing here: an open SQL statement must anyway be translated into a native SQL statement for the respective DBMS, so resolving a dynamic WHERE-condition along the way is probably not so much additional effort. As opposed to a LOOP AT statement, which is interpreted and executed on the application server. I assume this &lt;EM&gt;could&lt;/EM&gt; be introduced theoretically, but -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; 2. How would one implement a dynamic where clause for loop at itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like Christine and Martin I never missed this possibility in my practical work, so I wonder what your motivation is other than pure principle. Do you have an actual specification requiring dynamic WHERE conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ultimate weapon is dynamic program generation, but this is surely not for new ABAPers and is also condidered unnecessarily complex for most purposes. It's a potential security hazard as well that auditors love to complain about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2009 10:51:49 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2009-03-25T10:51:49Z</dc:date>
    <item>
      <title>Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404144#M1241204</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'm fairly new to ABAP and there is a lot to learn. I'm trying to use a dynamic where-clause in an LOOP AT statement. I've found a way to do this for a SELECT dbtab statement and thought this might be the same for the LOOP AT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at it_matchcluster into wa_matchcluster
  where (it_where_cluster).
  ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the internal table &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;it_where_cluster&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; contains several lines with correct logical expressions that should be and'ed.&lt;/P&gt;&lt;P&gt;However this gives me an compile error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions:&lt;/P&gt;&lt;P&gt;1. Generally why doesn't a dynamic where for the loop at statement on internal tables work the same as a dynamic where clause for a select on dbtabs? A logical expression is still a logical expression and in both cases it's evaluated at runtime not at compile time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. How would one implement a dynamic where clause for loop at itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reinhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 09:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404144#M1241204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404145#M1241205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you assume that the WHERE condition works the same way for SQL and LOOP AT....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said you are new to ABAP, so you cannot be making these assumptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404145#M1241205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404146#M1241206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's the logic of how formal languages work &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain why it doesn't work the same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:06:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404146#M1241206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404147#M1241207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simple answer is because it doesn't. It has not been designed that way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot compare ABAP to other languages that may be able to handle it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404147#M1241207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404148#M1241208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know that ABAP is different, powerful in some means but also dirty...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw. the documentation for SELECT states:&lt;/P&gt;&lt;P&gt;WHERE &amp;lt;log_exp&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the documentation for LOOP AT also states:&lt;/P&gt;&lt;P&gt;WHERE &amp;lt;log_exp&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though the definition of &amp;lt;log_exp&amp;gt; is different in both cases. A bad way to formally define a programming language in my opinion &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (And every programming language is a formal language)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, only a remark off-topic. It doesn't solve my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how can it be solved then? Worked around? Done right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:15:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404148#M1241208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404149#M1241209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; A bad way to formally define a programming language in my opinion &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (And every programming language is a formal language)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a go at creating your own then. Call it ZABAP or something. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been an ABAP programmer for 10 years and never need to use a dynamic where condition for a Loop. Maybe you need to look at changing how the Internal table is populated in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:26:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404149#M1241209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404150#M1241210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I know that ABAP is different, powerful in some means but also dirty...&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; btw. the documentation for SELECT states:&lt;/P&gt;&lt;P&gt;&amp;gt; WHERE &amp;lt;log_exp&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; and the documentation for LOOP AT also states:&lt;/P&gt;&lt;P&gt;&amp;gt; WHERE &amp;lt;log_exp&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Though the definition of &amp;lt;log_exp&amp;gt; is different in both cases. A bad way to formally define a programming language in my opinion &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (And every programming language is a formal language)&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Well, only a remark off-topic. It doesn't solve my problem.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; But how can it be solved then? Worked around? Done right?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Why do I get the impression that you have not been impressed by your experience of ABAP so far?  Anyway, I've never tried creating a dynamic where clause for a loop at an itab and don't think I've ever found a need to do so.  If you are a newcomer to ABAP, I'd try keeping it simple for the time being - in fact, keeping code as simple and as easily understood as possible and not doing unnecessarily complicated things just for the sake of it is good practice in any programming language (in my opinion).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you would need to use an IF to generate your dynamic where clause.  Instead, try running a different LOOP command for each of your IF conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Though the definition of &amp;lt;log_exp&amp;gt; is different in both cases. A bad way to formally define a programming language in my opinion &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (And every programming language is a formal language)&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why should WHERE  have to mean exactly the same thing for the two different examples given?  It just means that here you should insert a logical expression.  It doesn't mean that you can use the same logical expression for two different programming constructs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404150#M1241210</guid>
      <dc:creator>christine_evans</dc:creator>
      <dc:date>2009-03-25T10:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404151#M1241211</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;P&gt;LOOP AT t_matchcluster ASSIGNING &amp;lt;l_line&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT &amp;lt;dynamic_field&amp;gt; OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF &amp;lt;l_field&amp;gt; EQ (your condition)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404151#M1241211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404152#M1241212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; 1. Generally why doesn't a dynamic where for the loop at statement on internal tables work the same as a dynamic where clause for a select on dbtabs? A logical expression is still a logical expression and in both cases it's evaluated at runtime not at compile time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guessing here: an open SQL statement must anyway be translated into a native SQL statement for the respective DBMS, so resolving a dynamic WHERE-condition along the way is probably not so much additional effort. As opposed to a LOOP AT statement, which is interpreted and executed on the application server. I assume this &lt;EM&gt;could&lt;/EM&gt; be introduced theoretically, but -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; 2. How would one implement a dynamic where clause for loop at itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like Christine and Martin I never missed this possibility in my practical work, so I wonder what your motivation is other than pure principle. Do you have an actual specification requiring dynamic WHERE conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ultimate weapon is dynamic program generation, but this is surely not for new ABAPers and is also condidered unnecessarily complex for most purposes. It's a potential security hazard as well that auditors love to complain about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404152#M1241212</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-25T10:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404153#M1241213</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;Kindly go through this link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.susanto.id.au/papers/DynOpenSQL.asp#_Toc23566383" target="test_blank"&gt;http://www.susanto.id.au/papers/DynOpenSQL.asp#_Toc23566383&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:58:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404153#M1241213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T10:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404154#M1241214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The motivation for an dynamic where-clause is a quite complex search for duplicates in debitors or kreditors using different criterias and arbitrary combinations of these criterias (e.g. find all debitors that match in name AND tax number). This algorithm builds up two internal tables, one containing every debitor and the match-groups (a group is a set of debitors that match a specific criteria), the second table is a table containing all so called match-clusters (a match cluster is defined as a group of at least two identical match groups with at least two members).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously if you want arbitrary combinations of criterias (user defined) you need to dynamically select from those two internal tables if you don't want to do a calculation of those everytime you change the criteria-combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nevermind, I found a solution to the problem which isn't as elegant as if ABAP supported dynamic where clauses in the LOOP AT statement. This solution uses two more nested loops for the criteria table which isn't that big performance issue as long as there aren't too many criterias (which isn't the case for debitor matches).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reinhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 12:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404154#M1241214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404155#M1241215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting task, glad you found a workaround. Make sure you use internal tables defined as SORTED and use the defined key fields in the WHERE-conditions of the loops.&lt;/P&gt;&lt;P&gt;If you have done that already, you're not a "new ABAPer", at least not the usual one &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 12:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404155#M1241215</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-25T12:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404156#M1241216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As there will be lots of reads from those tables by the matching algorithms once they've been built up,  I decided to make those tables hashed ones. This should give an slight speedup if playing around with odd combinations of match criterias.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reinhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 13:41:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404156#M1241216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T13:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404157#M1241217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is an old thread but I found it when working on the same problem.&lt;/P&gt;&lt;P&gt;Ok, so we don`t have dynamic WHERE clause for LOOP statement.&lt;/P&gt;&lt;P&gt;I am not sure how exactly the guest, who asked the question, solved his problem, but I wanted to share my solution and ask if you, dear gurus and "gurettes" think it is effective or not.&lt;/P&gt;&lt;P&gt;Ok, so problem is: looking for duplicates, in my case it is looking for more and more specific subsets of the input set.&lt;/P&gt;&lt;P&gt;What I am doing:&lt;/P&gt;&lt;P&gt;1) understand which attrbutes have the best selectivity, so I remove as many records every round as possible&lt;/P&gt;&lt;P&gt;2) have two internal tables of type "RANGE" for attributes I test&lt;/P&gt;&lt;P&gt;3) every round I remove as many records as possible and for those which are not removed I put their name into the select option&lt;/P&gt;&lt;P&gt;    in next round i use my conditions which are not dynamic and add IN statement for the RANGE(S)&lt;/P&gt;&lt;P&gt;side-note) the numbers drop down very quickly so the performance is not bad at all&lt;/P&gt;&lt;P&gt;                 as a part of the solution one can write the LOOP AT again, this time with xxx IN LT_RNG_2 and NOT IN LT_RNG2&lt;/P&gt;&lt;P&gt;                 to learn which records were removed in this round.&lt;/P&gt;&lt;P&gt;I was researching how could I solve my problem in the most elegant way and didn`t find such way.&lt;/P&gt;&lt;P&gt;I am a) missing something very important despite the years of experience or b) there is no such way.&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Otto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 15:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404157#M1241217</guid>
      <dc:creator>OttoGold</dc:creator>
      <dc:date>2011-05-02T15:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404158#M1241218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In each round are you just LOOPing, or are you going to the database as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 15:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404158#M1241218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-02T15:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404159#M1241219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before I start the LOOP I beg the database for the first data set.&lt;/P&gt;&lt;P&gt;Then, with every LOOP, I reduce the records I really test (explicitely). Every line I touch I use for building the range that I use in the LOOP through "xx IN lt_rng". Basically I use range to test less and less records with every round and LOOP at the same data all the time, because the key of the table consists of multiple fields I work with (copying would be very ineffective and working with one column only is not possible because of the nature of the data).&lt;/P&gt;&lt;P&gt;Not sure how clear this is, but I think it is elegant and seems to be effective.&lt;/P&gt;&lt;P&gt;It is like version 22 of the report, so I hope it has some depth. On the ohter hand I have no idea how to measure if it really IS effective or if some other way would go better. I heard that sub-SELECTS can be slower than operations on the internal tables, I also heard that the effectivity of every statement depends on the way it is implemented in background and of course of attributes of the statements which one can only difficultly finetune without knowing the implementation.&lt;/P&gt;&lt;P&gt;Howgh. Not sure if this helps anybody, but I hope so and with this hope I write these lines.&lt;/P&gt;&lt;P&gt;Have a nice day everybody,&lt;/P&gt;&lt;P&gt;Otto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 16:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404159#M1241219</guid>
      <dc:creator>OttoGold</dc:creator>
      <dc:date>2011-05-02T16:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404160#M1241220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Otto,&lt;/P&gt;&lt;P&gt;dynamic WHERE-clauses for LOOPs have been introduced with Release 7.02 (EhP2), if you are lucky enough to work with this version already (I'm not).&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 16:32:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404160#M1241220</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-05-02T16:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404161#M1241221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ALV display with dynamic structure.&lt;/P&gt;&lt;P&gt;the user filters the list after the display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in my program I wish to filter the internal table based on the filters placed by the user at run time on the output list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This obiviously will require dynamic filtering from the internal table as it depends on the filters place on the output list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have some how implemented this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is based on the no. of filters placed, I am looping the internal table that many times to delete the irrevelent entries. This is degrading the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you have any suggestions?&lt;/P&gt;&lt;P&gt;I tried consulting some of my senior colleagues, but they said it is very specific case.&lt;/P&gt;&lt;P&gt;Unfortunately I am still working on 6.0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 14:23:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404161#M1241221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-06T14:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404162#M1241222</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;May be just put the deletion indicator 'ON' for such records in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you are through with your 'Loop' delete all records where deletion indicator is 'ON'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For updating the indicator use Field-Symbols, this will make it still better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raju chitale&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 11:19:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404162#M1241222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-07T11:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause for LOOP AT internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404163#M1241223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Former Member,&lt;/P&gt;&lt;P&gt;Use IT_FILTER parameter of method SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;You do not need to delete internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 11:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-for-loop-at-internal-table/m-p/5404163#M1241223</guid>
      <dc:creator>former_member209920</dc:creator>
      <dc:date>2012-06-07T11:31:34Z</dc:date>
    </item>
  </channel>
</rss>

