<?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: Internal Table Help Req?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991495#M706558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With just a quick glance, you need to move your sy-subrc directly after the read so that it looks something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_cdhdr-doc_no1 EQ it_cdpos-doc_no2.&lt;/P&gt;&lt;P&gt;DELETE it_cdhdr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also is it_cdhdr a header/workspace/structure?  If thats the case you need to clear the structure not delete it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2007 14:05:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-14T14:05:04Z</dc:date>
    <item>
      <title>Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991492#M706555</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 had 2 internal table : it_cdpos(4 Records) &amp;amp; it_cdhdr(6 Records)&lt;/P&gt;&lt;P&gt;it_cdpos :PO No.    Doc_No2             it_cdhdr : PO No.    Doc_No1   &lt;/P&gt;&lt;P&gt;               42           101                                  42           101&lt;/P&gt;&lt;P&gt;               42           102                                  42           102&lt;/P&gt;&lt;P&gt;               42           103                                  42           103&lt;/P&gt;&lt;P&gt;               42           104                                  42           104&lt;/P&gt;&lt;P&gt;                                                                     42           105&lt;/P&gt;&lt;P&gt;                                                                     42           106&lt;/P&gt;&lt;P&gt;    I want to delete the records of it_cdhdr,where Doc No is different.&lt;/P&gt;&lt;P&gt;I had written the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;    READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF it_cdhdr-doc_no1 EQ it_cdpos-doc_no2.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        DELETE it_cdhdr.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : it_cdhdr,it_cdpos.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any data to check,plz tell me that is the logic correct or there has to be change,coz I am not sure,when there will be records in it_cdpos,will the case :if sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;delete it_cdhdr.&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;will work or not,if it will be working than,its fine otheriwse how to code???plz tell me???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vipin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 13:56:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991492#M706555</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T13:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991493#M706556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;  As per my knowledge, it will work fine.. go ahead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sorry, i have one observation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at it_cdpos.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;IF it_cdhdr-doc_no1 EQ it_cdpos-doc_no2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;DELETE it_cdhdr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR : it_cdhdr,it_cdpos.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Endloop&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now it will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        pavan kumar pisipati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:01:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991493#M706556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991494#M706557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vipin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change code as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;clear it_cdpos.&lt;/P&gt;&lt;P&gt;READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IF sy-subrc = 0.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;IF it_cdhdr-doc_no1 &amp;lt;b&amp;gt;NE&amp;lt;/b&amp;gt; it_cdpos-doc_no2.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DELETE TABLE it_cdhdr.&lt;/P&gt;&lt;P&gt;DELETE TABLE it_cdpos.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR : it_cdhdr,it_cdpos.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:04:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991494#M706557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991495#M706558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With just a quick glance, you need to move your sy-subrc directly after the read so that it looks something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_cdhdr-doc_no1 EQ it_cdpos-doc_no2.&lt;/P&gt;&lt;P&gt;DELETE it_cdhdr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also is it_cdhdr a header/workspace/structure?  If thats the case you need to clear the structure not delete it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991495#M706558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991496#M706559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As it_cdpos is a item table I think you also need to replace READ with LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:05:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991496#M706559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991497#M706560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you think that,loop at it_cdpos after read statement, has to be there,as when  loop will be at index 1,on it_cdhdr,if it is going to chk for entire it_cdpos,it will completely my it_cdhdr except record at index 1 &amp;amp; it_cdpos table.&lt;/P&gt;&lt;P&gt;than again for loop on it_cdhdr at index 2,there will be no data in it_cdhdr &amp;amp; it_cdpos.than......the output will be just the record at index 1.???&lt;/P&gt;&lt;P&gt;i thnk it will be wrong.??????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991497#M706560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991498#M706561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First sort the two internal tables with the two fields....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa type it_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE it_cdpos into wa WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF wa-doc_no2 is initial.&lt;/P&gt;&lt;P&gt;DELETE it_cdhdr.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;clear wa.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991498#M706561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991499#M706562</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 think is is better than previous query:&lt;/P&gt;&lt;P&gt;  LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      DELETE TABLE it_cdhdr.&lt;/P&gt;&lt;P&gt;    ELSEIF it_cdhdr-changenr1 EQ it_cdpos-changenr2.&lt;/P&gt;&lt;P&gt;      DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;    ELSEIF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      DELETE TABLE it_cdhdr.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : it_cdhdr,it_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz tell me ????&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vipin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 14:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991499#M706562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T14:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991500#M706563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_cdhdr.

READ TABLE it_cdpos WITH KEY objectid = it_cdhdr-ebeln.
if sy-subrc = 0.
  l_index = sy-index.
  IF it_cdhdr-changenr1 EQ it_cdpos-changenr2
    DELETE TABLE it_cdpos index l_index.
  endif.
else
   DELETE TABLE it_cdhdr.
  continue.
ENDIF.

CLEAR : it_cdhdr,it_cdpos.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 15:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991500#M706563</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-11-14T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Table Help Req??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991501#M706564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT it_cdhdr.&lt;/P&gt;&lt;P&gt;LOOP AT it_cdpos WHERE objectid = it_cdhdr-ebeln AND changenr2 NE it_cdhdr-changenr1.&lt;/P&gt;&lt;P&gt;.DELETE TABLE it_cdpos.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;DELETE TABLE it_cdhdr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just use this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 15:04:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-help-req/m-p/2991501#M706564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T15:04:16Z</dc:date>
    </item>
  </channel>
</rss>

