附表排序后的ABAP简短转储 [英] ABAP Short Dump on append of a sorted table

查看:75
本文介绍了附表排序后的ABAP简短转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在排序表上添加一行时,为什么ABAP程序会短转储?

Why does my ABAP program short dump when I append a line to a sorted table?

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" 


推荐答案

程序以错误的排序顺序追加排序表

The program short dumps when appending a sorted table in the wrong 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"

请使用INSERT代替:

Use INSERT in stead:

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 键,因为使用两次相同的键,您仍然会得到短暂的转储

Note If you had a UNIQUE key you would still get a short dump because you're using the same key twice

这篇关于附表排序后的ABAP简短转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆