<?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 LOOP in Internal Table Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294423#M1635074</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't do a dynamic where condition in the LOOP, yo can use something like that with READ statament, but that means it can read one record only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to use the LOOP, you can only use the CHECK statament:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT &amp;lt;LT_TX&amp;gt; ASSIGNING &amp;lt;LS_TX&amp;gt;.
  ASSIGN COMPONENT (FIRSTCOL) OF STRUCTURE &amp;lt;LS_TX&amp;gt; TO &amp;lt;FS_TX&amp;gt;.
  CHECK &amp;lt;FS_TX&amp;gt; = 'A1'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Oct 2011 16:55:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-14T16:55:56Z</dc:date>
    <item>
      <title>Dynamic LOOP in Internal Table Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294422#M1635073</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;I have Dynamic Internal Table : &amp;lt;LT_TX&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

&amp;lt;LT_TX&amp;gt;

Col A        Time           Number
A1              01.2011        10
A2              02.2011         10
A1              03. 2011         10

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do LOOP AT on &amp;lt;LT_TX&amp;gt; with KEY COLA = A1 and hence ONLY LOOP AT 'A1' in THIS DYNAMIC INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

if I do like this, below i get an error, how to only LOOP AT A1 ones ?

data: firstcol type string value 'ColA'.

LOOP AT &amp;lt;LT_TX&amp;gt; ASSIGNING &amp;lt;LS_TX&amp;gt; WHERE (firstcol) = 'A1'.

ERROR:  in LOOP ... WHERE the line type of the table must be statically defined.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advice please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 16:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294422#M1635073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-14T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic LOOP in Internal Table Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294423#M1635074</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't do a dynamic where condition in the LOOP, yo can use something like that with READ statament, but that means it can read one record only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to use the LOOP, you can only use the CHECK statament:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT &amp;lt;LT_TX&amp;gt; ASSIGNING &amp;lt;LS_TX&amp;gt;.
  ASSIGN COMPONENT (FIRSTCOL) OF STRUCTURE &amp;lt;LS_TX&amp;gt; TO &amp;lt;FS_TX&amp;gt;.
  CHECK &amp;lt;FS_TX&amp;gt; = 'A1'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 16:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294423#M1635074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-14T16:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic LOOP in Internal Table Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294424#M1635075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't have a dynamic where in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FIELD-SYMBOS: &amp;lt;FIELD_1&amp;gt; TYPE ANY.

LOOP AT &amp;lt;LT_TX&amp;gt; ASSIGNING &amp;lt;LS_TX&amp;gt;.    "WHERE (firstcol) = 'A1'.

ASSIGN COMPONENT 1 OF STRUCTURE &amp;lt;LS_TX&amp;gt; TO &amp;lt;FIELD_1&amp;gt;.
IF &amp;lt;FIELD_1&amp;gt; EQ 'A1'.


ENDIF.

....
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 16:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-loop-in-internal-table-error/m-p/8294424#M1635075</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-10-14T16:56:47Z</dc:date>
    </item>
  </channel>
</rss>

