<?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 Statement for Deletion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920753#M1331478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tutun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for you answer, thats it for what I'm was looking for.&lt;/P&gt;&lt;P&gt;Rewarding points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2009 08:44:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-21T08:44:43Z</dc:date>
    <item>
      <title>Dynamic WHERE Statement for Deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920750#M1331475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAP Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like to delete several lines of an internal table using dynamic WHERE Statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea was the following, but it is not accepted by the compiler:&lt;/P&gt;&lt;P&gt;DELETE itab where (lt_where).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For select statement it works:&lt;/P&gt;&lt;P&gt;select count(*) from sflight where (lt_where)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other way to delete dynamically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 07:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920750#M1331475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T07:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic WHERE Statement for Deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920751#M1331476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Axel,&lt;/P&gt;&lt;P&gt;  use syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete itab where field(f1) not in lt_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this can solve your problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tutun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 08:09:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920751#M1331476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T08:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic WHERE Statement for Deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920752#M1331477</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;No, I don't think it's possible to use dynamic where condition, because it can be used for  SELECT statament only,&lt;/P&gt;&lt;P&gt;but u can try to use the field-symbols:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF T_WHERE OCCURS 0,
        FIELD(30) TYPE C,
        VALUE(30) TYPE C,
      END    OF T_WHERE.
      
FIELD-SYMBOLS: &amp;lt;FS&amp;gt; TYPE ANY.
      
      
..................
      
LOOP AT ITAB.
  LOOP AT T_WEHERE.
    ASSIGN COMPONENT T_WHERE-FIELD OF STRUCTURE ITAB TO &amp;lt;FS&amp;gt;.
    IF &amp;lt;FS&amp;gt; = T_WHERE-VALUE.
      OK_DELETE = 'X'.
    ELSE.
      CLEAR OK_DELETE.
      EXIT.
    ENDIF.
  ENDLOOP.
  CHECK OK_DELETE = 'X'.
  DELETE ITAB.
ENDLOOP. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or u can try to use statament DELETE with option WITH TABLE KEY, here u can assign dynamically the field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.DATA: BEGIN OF ITAB OCCURS 0,
       FIELD1,
       FIELD2,
     END OF ITAB.

DO 4 TIMES.
  ITAB-FIELD1 = 'A'.
  ITAB-FIELD2 = 'B'.
  APPEND ITAB.
ENDDO.

DO 4 TIMES.
  ITAB-FIELD1 = 'C'.
  ITAB-FIELD2 = 'B'.
  APPEND ITAB.
ENDDO.


LOOP AT ITAB.
  WRITE: / ITAB.
ENDLOOP.

DATA: FIELD1(30), FIELD2(30).

FIELD1 = 'FIELD1'.
FIELD2 = 'FIELD2'.
DO.
  DELETE TABLE ITAB WITH TABLE KEY (FIELD1) = 'A'
                                   (FIELD2) = 'B'.
  IF SY-SUBRC &amp;lt;&amp;gt; 0. EXIT. ENDIF.
ENDDO.
SKIP.

LOOP AT ITAB.
  WRITE: / ITAB.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 08:23:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920752#M1331477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T08:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic WHERE Statement for Deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920753#M1331478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tutun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for you answer, thats it for what I'm was looking for.&lt;/P&gt;&lt;P&gt;Rewarding points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 08:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-statement-for-deletion/m-p/5920753#M1331478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-21T08:44:43Z</dc:date>
    </item>
  </channel>
</rss>

