0

Why can't the append operation be performed on a sorted internal table, but a modify action can be performed?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • What makes you - incorrectly - assume that a) you can't use APPEND on sorted table and possibly b) MODIFY can be performed without issues on sorted tables? – vwegert May 30 '17 at 06:28
  • 1
    APPEND cannot be performed because it (as it obviously screams with its name) appends the data to a table and appending does not guarantee the sort order of the, surprise, surprise, sorted table to be kept. – Jagger May 30 '17 at 08:04
  • 1
    @Jagger: vwegert is right, you can use APPEND as long as you don't mess up the sort sequence. When doing so you get a nice dump explaining the error. :) – szako May 30 '17 at 08:33
  • 1
    There is a fine distinction between "I can't do this" and "I really shouldn't be doing this, should I?" that many developers tend to miss :-/ – vwegert May 30 '17 at 10:30
  • 1
    Possible duplicate of [ABAP Short Dump on append of a sorted table](https://stackoverflow.com/questions/1518465/abap-short-dump-on-append-of-a-sorted-table) – gkubed May 30 '17 at 15:03

1 Answers1

0

APPEND will adds the line to the internal table one after the other, if the sort sequence is not kept the program will dump, on sorted table should use INSERT instead of APPEND.