<?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: Error while Sorting decending in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977196#M1604332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.. now I understand the direction and reasoning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did make the changes where suggested as follows and all worked find.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SORT it_ints2 STABLE ASCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
  SORT it_ints STABLE ASCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.

  SORT it_ints STABLE DESCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
  SORT it_ints STABLE ASCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jun 2011 10:32:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-21T10:32:20Z</dc:date>
    <item>
      <title>Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977175#M1604311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have come across an issue when sorting descending that I can't explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to disiplay an internal table in a particular descending order, however if I sort before I display descending, and then resort without parameters, the values in the table are no longer equal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code is enough to prove my issue.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  int_rec    LIKE zcrd_intrate,
  it_ints    LIKE STANDARD TABLE OF int_rec,
  it_ints2   LIKE STANDARD TABLE OF int_rec.

  SELECT * INTO TABLE it_ints
    FROM zcrd_intrate
    WHERE rectyp = 'OO'.

  it_ints2 = it_ints.

  SORT it_ints2.
  SORT it_ints DESCENDING BY fico_high
                             term_high
                             ltv_high
                             eff_dt_high.
  SORT it_ints.

  IF it_ints NE it_ints2.
{color:red}    WRITE:/ 'We have an issue'.{color}
    PERFORM print_them.
  ELSE.
{color:green}  WRITE:/ 'All''s good'.{color}
    PERFORM print_them.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I constantly get the message 'We have an issue'.&lt;/P&gt;&lt;P&gt;I have tried reducing the number of fields from 4, 3 , 2 and finally 1, with no difference.&lt;/P&gt;&lt;P&gt;I have tried using [] after the table name where appropiate all with the same issue.&lt;/P&gt;&lt;P&gt;I also have taken out the DESCENDING BY sort and when that test is run, the result is the 'All''s good' message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions are welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table row is defiened as :&lt;/P&gt;&lt;P&gt;Field	Pos	Key	Data Element	Type 	Len		Domain&lt;/P&gt;&lt;P&gt;MANDT	1	X	MANDT	CLNT	3		MANDT&lt;/P&gt;&lt;P&gt;RECTYP	2	X	ZINT_REC_TYP	CHAR	2		ZINT_REC_TYP&lt;/P&gt;&lt;P&gt;FICO_HIGH	3	X	ZFICO_SCORE	NUMC	3		NUM3&lt;/P&gt;&lt;P&gt;FICO_LOW	4	X	ZFICO_SCORE	NUMC	3		NUM3&lt;/P&gt;&lt;P&gt;TERM_HIGH	5	X	Z_TERM_HIGH	NUMC	3		Z_TERM&lt;/P&gt;&lt;P&gt;TERM_LOW	6	X	Z_TERM_LOW	NUMC	3		Z_TERM&lt;/P&gt;&lt;P&gt;LTV_HIGH	7	X	ZLTV_D	DEC	5	2	ZLTV_D&lt;/P&gt;&lt;P&gt;LTV_LOW	8	X	ZLTV_D	DEC	5	2	ZLTV_D&lt;/P&gt;&lt;P&gt;EFF_DT_HIGH	9		Z_EFF_DATE_HIGH	DATS	8		DATUM&lt;/P&gt;&lt;P&gt;EFF_DT_LOW	10		Z_EFF_DATE_LOW	DATS	8		DATUM&lt;/P&gt;&lt;P&gt;INT_RATE	11		ZCRD_RATE	DEC	12	3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator Message: Please use more descriptive subject lines while asking your question!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jun 20, 2011 5:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 11:45:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977175#M1604311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T11:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977176#M1604312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F1 on the SORT keyword reveals the problem, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Sorting is instable by default, which means that the relative order of rows that do not have different sort keys is not retained when they are sorted, and &lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;can change when you sort more than once&lt;/SPAN&gt;. The addition STABLE can be used for stable sorting.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 12:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977176#M1604312</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-06-20T12:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977177#M1604313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suhas, thanks for the reply.  Unfortunetly, this did not help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table has 9 key fields after the MANDT field.  Only field that is not a key is the interest rate.&lt;/P&gt;&lt;P&gt;I modified the program by adding a delete adjacent duplicates as well as sorting on all 9 key fields.&lt;/P&gt;&lt;P&gt;Same problem resulted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I additionaly tested by counting records before and after the delete.  No rows deleted.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REFRESH it_ints.
  REFRESH it_ints2.

  SELECT * INTO TABLE it_ints
    FROM zcrd_intrate
    WHERE rectyp = rectyp.

  it_ints2 = it_ints.

**  PERFORM print_them.   NEW-PAGE.

  DELETE ADJACENT DUPLICATES FROM it_ints COMPARING ALL FIELDS.

**  PERFORM print_them.   NEW-PAGE.

  SORT it_ints2.
  SORT it_ints STABLE DESCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
  SORT it_ints.

  IF it_ints NE it_ints2.
    WRITE:/ 'We have an issue'.
**    PERFORM print_them.
  ELSE.
    WRITE:/ 'All''s good'.
**    PERFORM print_them.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:03:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977177#M1604313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T13:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977178#M1604314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Default sort order is ascending.&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;SORT it_ints2.&lt;/P&gt;&lt;P&gt;sorts in ASCENDING order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977178#M1604314</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2011-06-20T13:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977179#M1604315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although you are correct,  you will note that after I sort the one table descending, I immediatly sort it which again will sort it ascending prior to the compare.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:32:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977179#M1604315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T13:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977180#M1604316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right. I missed this part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming back to SATBLE sorting. Did you try to sort stable both tables before comparing?&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_ints2 STABLE.
  SORT it_ints STABLE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;Added code tags&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jun 20, 2011 7:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:45:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977180#M1604316</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2011-06-20T13:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977181#M1604317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with a sample program on SBOOK table &amp;amp; it works OK for me! I understand the inconsistent behaviour(between your program &amp;amp; mine) is because SAP has mentioned multiple SORTs on the same table &lt;U&gt;can&lt;/U&gt; result in relative order of rows being changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gt_book     TYPE STANDARD TABLE OF sbook,
      gt_book_dup TYPE STANDARD TABLE OF sbook.

SELECT * FROM sbook
  INTO TABLE gt_book
  WHERE carrid = 'AA'.

gt_book_dup = gt_book.
SORT gt_book_dup STABLE.

SORT gt_book STABLE DESCENDING BY bookid customid luggweight forcuram
order_date.

SORT gt_book STABLE.

IF gt_book NE gt_book_dup.
  WRITE: / 'We have error'.
ELSE.
  WRITE / 'We are OK'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway did you try to stabilise each SORT as Tomek has mentioned? If you're using the new debugger you can use the [Diff tool|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/2c/840b42202cce6ce10000000a155106/content.htm] to analyse the differences!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jun 20, 2011 7:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:59:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977181#M1604317</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-06-20T13:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977182#M1604318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Results where the same.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REFRESH it_ints.
  REFRESH it_ints2.

  SELECT * INTO TABLE it_ints
    FROM zcrd_intrate
    WHERE rectyp = rectyp.

  it_ints2 = it_ints.

**  PERFORM print_them.   NEW-PAGE.

  DELETE ADJACENT DUPLICATES FROM it_ints COMPARING ALL FIELDS.

**  PERFORM print_them.   NEW-PAGE.

  SORT it_ints2 STABLE.
  SORT it_ints STABLE DESCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
  SORT it_ints STABLE.

  IF it_ints NE it_ints2.
    WRITE:/ 'We have an issue'.
**    PERFORM print_them.
  ELSE.
    WRITE:/ 'All''s good'.
**    PERFORM print_them.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:00:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977182#M1604318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T14:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977183#M1604319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With this concept, before the descending, I used STABLE on both, and result was data was equal.  No Issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REFRESH it_ints.
  REFRESH it_ints2.

  SELECT * INTO TABLE it_ints
    FROM zcrd_intrate
    WHERE rectyp = rectyp.

  it_ints2 = it_ints.

**  PERFORM print_them.   NEW-PAGE.

  DELETE ADJACENT DUPLICATES FROM it_ints COMPARING ALL FIELDS.

**  PERFORM print_them.   NEW-PAGE.

  SORT it_ints2 STABLE.
  SORT it_ints STABLE.

  IF it_ints NE it_ints2.
    WRITE:/ 'We have an issue'.
**    PERFORM print_them.
  ELSE.
    WRITE:/ 'All''s good'.
**    PERFORM print_them.
  ENDIF.

  SORT it_ints STABLE DESCENDING BY
                             rectyp
                             fico_high
                             fico_low
                             term_high
                             term_low
                             ltv_high
                             ltv_low
                             eff_dt_high
                             eff_dt_low.
  SORT it_ints STABLE.

  IF it_ints NE it_ints2.
    WRITE:/ 'We have an issue'.
**    PERFORM print_them.
  ELSE.
    WRITE:/ 'All''s good'.
**    PERFORM print_them.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977183#M1604319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T14:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977184#M1604320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't seem to have DIFF too.   I am running on 4.6e.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977184#M1604320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T14:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977185#M1604321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm on release 701 &amp;amp; i suppose i can't replicate your situation! Could you just execute my code snippet &amp;amp; check the output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me just add i didn't seem to have problem without the STABLE addition. In both the cases multiple SORTs did not result in any differences!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFAIK the new debugger is not available in 4.6E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:17:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977185#M1604321</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-06-20T14:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977186#M1604322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code ran properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT YPTCX_SORT_DESC_ISSUE .

DATA: gt_book     TYPE STANDARD TABLE OF sbook,
      gt_book_dup TYPE STANDARD TABLE OF sbook.

SELECT * FROM sbook
  INTO TABLE gt_book
  WHERE carrid = 'AA'.

gt_book_dup = gt_book.
SORT gt_book_dup STABLE.

SORT gt_book STABLE DESCENDING BY bookid customid luggweight forcuram
order_date.

SORT gt_book STABLE.

IF gt_book NE gt_book_dup.
  WRITE: / 'We have error'.
ELSE.
  WRITE / 'We are OK'.           "&amp;lt;=======  got this message
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977186#M1604322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T14:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977187#M1604323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many records do you have in it_ints?&lt;/P&gt;&lt;P&gt;Would it be possible to paste the data here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:26:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977187#M1604323</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2011-06-20T14:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977188#M1604324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;162 Records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 2 LTV and the Int rate field are defined as Dec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did email the data to you as well as screen shot of the Table Structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977188#M1604324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T15:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977189#M1604325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What business req are you trying to achieve by Sorting by a set order and then Sorting again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also - I might suggest declaring your tables as SORTED tables with a declared table key - but again, I am unsure of your business req(s).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 16:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977189#M1604325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T16:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977190#M1604326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I sort with the descending to show the most current  row and descention by the other catagories.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user then can change the data.  When they exit, I resort back to the original order and check to see if the data has changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I the case listed, without changing data, I'm always getting flagged that the data is changed and thus will ask the user if they want to save it before exiting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 16:54:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977190#M1604326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T16:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977191#M1604327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I follow you, then do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) SELECT the data from the DB into a local table - as you are currently&lt;/P&gt;&lt;P&gt;2) Sort the data in that local table (calling it CURRent - for now) and include ALL fields in that SORT&lt;/P&gt;&lt;P&gt;3) Copy that now sorted CURR table into an ORIGinal table - as you are currently&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Allow the user to "play with" the CURR table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) At time of save, take the CURR table (which may have been changed) and sort it again using the same sort order declared in Step 2 (all fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Now do "IF it_Curr[ ] NE it_ORIG[ ]" --&amp;gt; then changes were made, so expose the save changes pop-up&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also - if you are using an ALV grid for the CURR table, you can look it Method CHECK_CHANGED_DATA in the ALV Grid class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 18:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977191#M1604327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T18:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977192#M1604328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only differences that I see with your suggestions are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data would both be sorted in descending prior to "user play time"&lt;/P&gt;&lt;P&gt;Upon return would sort again descending&lt;/P&gt;&lt;P&gt;Compare based on both tables descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, you mention sorting with just the data fields.&lt;/P&gt;&lt;P&gt;The only additional fields would be MANDT and the create date/time/user as well as the Change date/time/user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I can see the work around using this method, it doesn't provide me with the confidence knowing that the base sort of both tables should be identical when no data is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I have been showing is a snipet of the total program in a work program to isolate the issue and know why this is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 18:33:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977192#M1604328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T18:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977193#M1604329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your sample code, the base sorts are not the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are sorting one of the table twice - and not using all of the fields in the sort.  Without a well defined key for uniqueness, ABAP (or any prog lang) can not guarantee the same sort order.  The same sort order is only guaranteed when all fields (data or key fields) are included.  In your case, using ALL of the fields in an ASCENDING/DESCENDING BY clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 19:41:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977193#M1604329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-20T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error while Sorting decending</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977194#M1604330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agree  with John.&lt;/P&gt;&lt;P&gt;You should either sort using all fields (at least all which are part of the db table key) or declare the internal tables specifying the key explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you declare&lt;/P&gt;&lt;P&gt;it_ints    LIKE STANDARD TABLE OF int_rec&lt;/P&gt;&lt;P&gt;system creates default key consisting of all character-like fields which is different from your db key as it doesn't include LTV_HIGH and LTV_LOW which are DEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Statement &lt;/P&gt;&lt;P&gt;SORT it_ints.&lt;/P&gt;&lt;P&gt;uses this default key and that's why you get these unpredictable results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to summarize:&lt;/P&gt;&lt;P&gt;- either declare it_ints and it_ints2 specifying key fields (same fields as DB key)&lt;/P&gt;&lt;P&gt;- or use these fields explicitly when sorting instead of just 'SORT it_ints'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 19:48:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-sorting-decending/m-p/7977194#M1604330</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2011-06-20T19:48:07Z</dc:date>
    </item>
  </channel>
</rss>

