<?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: Dump in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239430#M1381950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Neliea,&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                    You are applying loop on internal table and same line you are deleating for which loop is running.Its a wrong procedure you have to take all that records in your new internal table and then you have to delete from your master internal table.&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shrikant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Oct 2009 11:10:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-05T11:10:52Z</dc:date>
    <item>
      <title>Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239421#M1381941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im having a piece of code as mentioned below,DETAIL table has 1 lak records and IT_MSEG has 20,000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is taking time and going to dump.please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT IT_MSEG BY BELNR MATNR.&lt;/P&gt;&lt;P&gt;sort detail by belnr matnr.&lt;/P&gt;&lt;P&gt;LOOP AT DETAIL.&lt;/P&gt;&lt;P&gt;READ TABLE IT_MSEG WITH KEY BELNR = DETAIL-BELNR MATNR = DETAIL-MATNR&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;DELETE DETAIL WHERE BELNR = DETAIL-BELNR AND MATNR = DETAIL-MATNR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CLEAR:DETAIL,IT_MSEG.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Neliea on Sep 30, 2009 11:55 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Sep 30, 2009 2:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 09:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239421#M1381941</guid>
      <dc:creator>former_member377111</dc:creator>
      <dc:date>2009-09-30T09:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239422#M1381942</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;the DELETE WHERE on table DETAIL can not be optimized in case it is a standard table.&lt;/P&gt;&lt;P&gt;The SORT for table DETAIL is therefore not necessary. &lt;/P&gt;&lt;P&gt;The DELETE WHERE can only be optimized if you use a SORTED TABLE for DETAIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But since you delete the record which currently processed by the loop you can&lt;/P&gt;&lt;P&gt;simply use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete detail (which deletes the current line without doing  a search).&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;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 10:07:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239422#M1381942</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-09-30T10:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239423#M1381943</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;For better performance, Do Not Delete the  entries inside the LOOP-ENDLOOP...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Redundant Sort on DETAIL table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT IT_MSEG BY BELNR MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT DETAIL into WA_DETAIL.&lt;/P&gt;&lt;P&gt;READ TABLE IT_MSEG WITH KEY BELNR = WA_DETAIL-BELNR MATNR = WA_DETAIL-MATNR&lt;/P&gt;&lt;P&gt;                                                                                binary search.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.   " Move into a local internal table&lt;/P&gt;&lt;P&gt;WA_TEMP  = WA_DETAIL&lt;/P&gt;&lt;P&gt;Append WA_TEMP to LT_TEMP.&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;If Required...Now Refresh the table IT_MSEG and Fill the data from LT_TEMP.&lt;/P&gt;&lt;P&gt;Refresh IT_MSEG&lt;/P&gt;&lt;P&gt;IT_MSEG = LT_TEMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shiva Kumar Tirumalasetty on Sep 30, 2009 3:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 10:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239423#M1381943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-30T10:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239424#M1381944</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;  What you are trying to do is deleting all entries in detail which have the an entry in IT_MSEG for the combination of belnr and matnr so why dont you try like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at it_mkpf.
  delete detail where belnr = it_mkpf and matnr = it_mkpf-matnr.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 10:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239424#M1381944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-30T10:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239425#M1381945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 12:21:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239425#M1381945</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-09-30T12:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239426#M1381946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take off the WHERE condition on the DELETE. You don't need it and this is what is slowing you down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 13:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239426#M1381946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-30T13:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239427#M1381947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nelia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS &amp;lt;fs_detail&amp;gt; LIKE LINE OF DETAIL.
SORT IT_MSEG BY BELNR MATNR.
LOOP AT DETAIL ASSIGNING &amp;lt;fs_detail&amp;gt;.
  lv_index = sy-tabix.
  READ TABLE IT_MSEG WITH KEY BELNR = &amp;lt;fs_detail&amp;gt;-BELNR
                              MATNR = &amp;lt;fs_detail&amp;gt;-MATNR
                              BINARY SEARCH
                              TRANSPORTING NO FIELDS.
  IF sy-subrc NE 0.
    DELETE DETAIL INDEX lv_index.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;- it's necessary only sort IT_MSEG (already mentioned)&lt;/P&gt;&lt;P&gt;- delete direct by index (already mentioned)&lt;/P&gt;&lt;P&gt;- field-symbols isn't mandatory I use it to avoid copy to header-line, minor speed up&lt;/P&gt;&lt;P&gt;- transporting no fields is used for the same reason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 21:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239427#M1381947</guid>
      <dc:creator>former_member182114</dc:creator>
      <dc:date>2009-10-01T21:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239428#M1381948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the following logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_mseg,
         ...
         belnr TYPE mseg-belnr,
         ...
         matnr TYPE mseg-matnr,
         ...
       END OF ty_mseg,
       
       BEGIN OF ty_detail,
         ...
         belnr  TYPE mseg-belnr,
         ...
         matnr  TYPE mseg-matnr,
         ...
         del(1) TYPE c         ,
       END OF ty_detail.

DATA: w_detail    TYPE                 ty_detail,
      w_index     TYPE                 sy-tabix ,

      it_mseg     TYPE SORTED TABLE OF ty_mseg
        WITH NON-UNIQUE KEY belnr matnr,
      it_mseg_tmp TYPE        TABLE OF ty_mseg  ,
      it_detail   TYPE        TABLE OF ty_detail.


it_mseg_tmp[] = it_mseg[].

DELETE ADJACENT DUPLICATES FROM it_mseg COMPARING belnr matnr.

LOOP AT it_detail INTO w_detail.

  w_index = sy-tabix.

  READ TABLE it_mseg WITH KEY belnr = w_detail-belnr
                              matnr = w_detail-matnr
                              TRANSPORTING NO FIELDS.

  CHECK sy-subrc NE 0.

  w_detail-del = 'X'.

  MODIFY it_detail FROM w_detail
    INDEX w_index
    TRANSPORTING
      del.

ENDLOOP.

DELETE it_detail WHERE del EQ 'X'.

it_mseg[] = it_mseg_tmp[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 14:07:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239428#M1381948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-02T14:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239429#M1381949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make  IT_MSEG a sorted table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS &amp;lt;fs_detail&amp;gt; LIKE LINE OF DETAIL.

LOOP AT DETAIL ASSIGNING &amp;lt;fs_detail&amp;gt;.
  lv_index = sy-tabix.
  READ TABLE IT_MSEG WITH TABLE KEY BELNR = &amp;lt;fs_detail&amp;gt;-BELNR
                              MATNR = &amp;lt;fs_detail&amp;gt;-MATNR
                              BINARY SEARCH
                              TRANSPORTING NO FIELDS.
  IF sy-subrc NE 0.
  &amp;lt;fs_detail&amp;gt;-delflg = 'X'.
  ENDIF.
ENDLOOP.

delete detail where delflg = 'X'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does detail has multiple entries for it_mseg if so you better loop it_mseg and read detail &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nafran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 06:32:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239429#M1381949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-05T06:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239430#M1381950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Neliea,&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                    You are applying loop on internal table and same line you are deleating for which loop is running.Its a wrong procedure you have to take all that records in your new internal table and then you have to delete from your master internal table.&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shrikant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 11:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239430#M1381950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-05T11:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239431#M1381951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT IT_MSEG BY BELNR MATNR.&lt;/P&gt;&lt;P&gt;sort detail by belnr matnr.&lt;/P&gt;&lt;P&gt;LOOP AT DETAIL.&lt;/P&gt;&lt;P&gt;READ TABLE IT_MSEG WITH KEY BELNR = DETAIL-BELNR MATNR = DETAIL-MATNR&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;DELETE DETAIL . The conditions will not be required as the cussor will remain at the same place.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CLEAR:DETAIL,IT_MSEG.&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;Let me now the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prithwi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2009 22:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239431#M1381951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-06T22:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239432#M1381952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 06:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dump/m-p/6239432#M1381952</guid>
      <dc:creator>former_member377111</dc:creator>
      <dc:date>2009-10-07T06:56:20Z</dc:date>
    </item>
  </channel>
</rss>

