<?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: table sorting. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091037#M1181759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check if the Allocation have one duplicate entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beacues for second code:&lt;/P&gt;&lt;P&gt;DELETE t_lae_cr WHERE allocation_id = t_lae_cr-allocation_id.&lt;/P&gt;&lt;P&gt;The delet is happenig when allocation_id matches..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternate Code for 2:&lt;/P&gt;&lt;P&gt;LOOP AT t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5'&lt;/P&gt;&lt;P&gt;DELETE t_lae_cr index sy-tabix.&lt;/P&gt;&lt;P&gt;CLEAR t_lae_cr.&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;For 1st code:Allocation Id is not considered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2009 09:04:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-06T09:04:17Z</dc:date>
    <item>
      <title>table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091030#M1181752</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 am using below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code no 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort    t_lae_cr by allocation_id event status procmode.&lt;/P&gt;&lt;P&gt;  delete  t_lae_cr  where event = 'NEWL' and status eq '9' and procmode  eq '5' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after executing above commands i get 284 records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when i used below code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code no 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5'&lt;/P&gt;&lt;P&gt;    DELETE t_lae_cr WHERE allocation_id = t_lae_cr-allocation_id.&lt;/P&gt;&lt;P&gt;    CLEAR t_lae_cr.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after executing above command i get 283 records.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i just want to know why record count is not coming same in both the codes when they are doing the same tasks.  is there any sorting issue in code 1 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 08:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091030#M1181752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T08:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091031#M1181753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In first code you havenot checked for allocation_id ,but in the second one while deleting you are checking it.&lt;/P&gt;&lt;P&gt;This might be the reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 08:55:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091031#M1181753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T08:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091032#M1181754</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;according to me ,  in 2 code :   the delete statement in loop is deleting the 1 record corresponding to that allocation id, on basis of which you are deleting in loop.&lt;/P&gt;&lt;P&gt;so 283 records are left.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 08:56:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091032#M1181754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T08:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091033#M1181755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Tell me before deleting,  the original no of records is 285 or anything else  !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates deletes duplicates and one original remains in the table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But  here in second DELETE condition you are deleting  all the duplicate and original records of the for which there are duplicates in the table .&lt;/P&gt;&lt;P&gt;As far my guess there is only one record  that have duplicate records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 08:59:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091033#M1181755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T08:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091034#M1181756</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;&lt;/P&gt;&lt;P&gt;you're checking the value of the row on code 2 before deleting. Try to remove the &lt;STRONG&gt;WHERE&lt;/STRONG&gt; clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mon Magallanes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:00:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091034#M1181756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091035#M1181757</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;Do  a small change in ur code 2 and see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code no 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_lae_cr by allocation_id event status procmode.&lt;/P&gt;&lt;P&gt;delete t_lae_cr where event = 'NEWL' and status eq '9' and procmode eq '5' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after executing above commands i get 284 records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when i used below code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code no 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5'&lt;/P&gt;&lt;P&gt;DELETE t_lae_cr .&lt;/P&gt;&lt;P&gt;CLEAR t_lae_cr.&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;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091035#M1181757</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2009-02-06T09:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091036#M1181758</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;PRE&gt;&lt;CODE&gt;DELETE t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5' .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To acheive this using loop you shud write,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5'
DELETE t_lae_cr. "You have added one more condition here
CLEAR t_lae_cr.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:04:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091036#M1181758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091037#M1181759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check if the Allocation have one duplicate entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beacues for second code:&lt;/P&gt;&lt;P&gt;DELETE t_lae_cr WHERE allocation_id = t_lae_cr-allocation_id.&lt;/P&gt;&lt;P&gt;The delet is happenig when allocation_id matches..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternate Code for 2:&lt;/P&gt;&lt;P&gt;LOOP AT t_lae_cr WHERE event = 'NEWL' AND status EQ '9' AND procmode EQ '5'&lt;/P&gt;&lt;P&gt;DELETE t_lae_cr index sy-tabix.&lt;/P&gt;&lt;P&gt;CLEAR t_lae_cr.&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;For 1st code:Allocation Id is not considered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:04:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091037#M1181759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091038#M1181760</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;it is very simple,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this eg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;allocation_id    event           status       procmode&lt;/P&gt;&lt;P&gt;100                  NEWL             9           5      &lt;/P&gt;&lt;P&gt;100                  NEWL             8           5            &lt;/P&gt;&lt;P&gt;101                  NEWL             9           5           &lt;/P&gt;&lt;P&gt;102                  NEWL             9           5               &lt;/P&gt;&lt;P&gt;102                  NEWL             7           5           &lt;/P&gt;&lt;P&gt;103                  ABCD             5            3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According code 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U'll get like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;allocation_id    event           status       procmode&lt;/P&gt;&lt;P&gt;100                  NEWL             8           5      &lt;/P&gt;&lt;P&gt;102                  NEWL             7           5      &lt;/P&gt;&lt;P&gt;103                  ABCD             5            3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Accoding code 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;allocation_id    event           status       procmode&lt;/P&gt;&lt;P&gt;103                  ABCD             5            3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second code u r using allocation Id to delete the records.&lt;/P&gt;&lt;P&gt;when allocation Id is 100 , u have to delete only one record which satisfies. But when u delete in the second code both the records are deleted because allocation Id is same for next record also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:07:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091038#M1181760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: table sorting.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091039#M1181761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Their might be a possibility that while loop into your internal table the header record is getting deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bcoz's your internal table is a table with header line.&lt;/P&gt;&lt;P&gt;That's why u r getting one record less.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an internal table with a workarea. like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_lae_cr  like standard table of &amp;lt;WA&amp;gt;.&lt;/P&gt;&lt;P&gt;and then proceed with your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also try removing the CLEAR Statement from your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it's clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ravi Aswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-sorting/m-p/5091039#M1181761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:17:34Z</dc:date>
    </item>
  </channel>
</rss>

