Skip to Content
avatar image
Former Member

sort a sorted internal table

Hi,

If an internal table is sorted or almost sorted, if we sort it again, does it take the same time as it is not sorted at all?


I ask this question because sometimes you do some modifies on a long code which is written by others, you don't want to read the entire code but you need a sorted internal table. If sort a sorted table doesn't take too much time, then I can singly put a SORT before entering LOOP.

Otherwise I have to read the all code to make sure the internal table is sorted only once.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 11, 2015 at 02:11 AM

    Hi Ming,

    I think it will sort it again and less time take, due to  there is no flag to indicate this itab increased data or not compare with last sort.

    regards,

    Archer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2015 at 05:13 AM

    Hi Ming,

    I think we cannot sort the sorted table.

    correct me if i am wrong.

    Thanks,

    Marimuthu.K

    Add comment
    10|10000 characters needed characters exceeded