<?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: Delete specified records from IT Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230805#M1380577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to empty field num(xx) if corresponding field com(xx) eq 'WORK' ? Do I understand it correctly?&lt;/P&gt;&lt;P&gt;If so then you can use this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols: &amp;lt;num&amp;gt;, &amp;lt;com&amp;gt;.

data: com(5) type c, 
         num(5) type c.
        idx(2) type n.

Loop at LT_ZGESTOR.
 do 6 times.
   idx = sy-index.   "01, 02, 03, ...
   concatenate 'COM' idx into com.  "COM01, COM02,....
   concatenate 'NUM' idx into num.  "NUM01, NUM02 ...
   
   assign component: COM of structure LT_ZGESTOR to &amp;lt;com&amp;gt;,
                                  NUM of structure LT_ZGESTOR to &amp;lt;num&amp;gt;.
   if &amp;lt;com&amp;gt; = 'WORK'.
       clear &amp;lt;num&amp;gt;.
   endif.        
 enddo.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want to delete records where COM(XX) eq 'WORK'.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"just change this
...
   if &amp;lt;com&amp;gt; = 'WORK'.
       delete LT_ZGESTOR index sy-tabix.
       exit.  "exit DO loop and get next record
   endif.    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2009 13:31:19 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2009-10-08T13:31:19Z</dc:date>
    <item>
      <title>Delete specified records from IT Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230803#M1380575</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've this SELECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT com01 num01 com02 num02 com03 num03&lt;/P&gt;&lt;P&gt;         com04 num04 com05 num05 com06 num06 FROM pa0006&lt;/P&gt;&lt;P&gt;     INTO CORRESPONDING FIELDS OF TABLE lt_zgestor&lt;/P&gt;&lt;P&gt;    WHERE pernr EQ l_pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want delete select from LT_ZGESTOR ,  field num(xx) where com(xx) eq 'WORK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 13:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230803#M1380575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-08T13:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete specified records from IT Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230804#M1380576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
delete lt_zgestor where com01 = 'WORK' OR com02 = 'WORK' ......com05 = 'WORK'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 13:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230804#M1380576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-08T13:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete specified records from IT Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230805#M1380577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to empty field num(xx) if corresponding field com(xx) eq 'WORK' ? Do I understand it correctly?&lt;/P&gt;&lt;P&gt;If so then you can use this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols: &amp;lt;num&amp;gt;, &amp;lt;com&amp;gt;.

data: com(5) type c, 
         num(5) type c.
        idx(2) type n.

Loop at LT_ZGESTOR.
 do 6 times.
   idx = sy-index.   "01, 02, 03, ...
   concatenate 'COM' idx into com.  "COM01, COM02,....
   concatenate 'NUM' idx into num.  "NUM01, NUM02 ...
   
   assign component: COM of structure LT_ZGESTOR to &amp;lt;com&amp;gt;,
                                  NUM of structure LT_ZGESTOR to &amp;lt;num&amp;gt;.
   if &amp;lt;com&amp;gt; = 'WORK'.
       clear &amp;lt;num&amp;gt;.
   endif.        
 enddo.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want to delete records where COM(XX) eq 'WORK'.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"just change this
...
   if &amp;lt;com&amp;gt; = 'WORK'.
       delete LT_ZGESTOR index sy-tabix.
       exit.  "exit DO loop and get next record
   endif.    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 13:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-specified-records-from-it-table/m-p/6230805#M1380577</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-10-08T13:31:19Z</dc:date>
    </item>
  </channel>
</rss>

