12

ソートされたテーブルに行を追加すると、ABAP プログラムがショート ダンプするのはなぜですか?

ST22ショーITAB_ILLEGAL_SORT_ORDER

data: sorted_tab type sorted table of ty_tab with non-unique key key,
      line       type ty_tab.

line-key = 1. 
append line to sorted_tab.  "works fine" 

line-key = 2. 
append line to sorted_tab.  "works fine" 

line-key = 1. 
append line to sorted_tab.  "<==== Short dump here" 
4

1 に答える 1

19

ソートされたテーブルを間違ったソート順で追加すると、プログラムのショートダンプが発生する

data: sorted_tab type sorted table of ty_tab with non-unique key key,
      line       type ty_tab.

line-key = 1.
append line to sorted_tab.  "works fine"

line-key = 2.
append line to sorted_tab.  "works fine"

line-key = 1.
append line to sorted_tab.  "<==== Short dump here"

代わりに INSERT を使用します。

data: sorted_tab type sorted table of ty_tab with non-unique key key,
      line       type ty_tab.

line-key = 1.
insert line into table sorted_tab.  "works fine"

line-key = 2.
insert line into table sorted_tab.  "works fine"    

line-key = 1.
insert line into table sorted_tab.  "works fine"

UNIQUEキーを使用している場合でも、同じキーを 2 回使用しているため、短いダンプが得られます。

于 2009-10-05T06:08:03.680 に答える