Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg dump ITAB_ILLEGAL_SORT_ORDER

Former Member
0 Kudos

Hi..

I have scheduled one job .The job has cancelled and its throws erro like

ITAB_ILLEGAL_SORT_ORDER.

1)In the dump analysis its shows the err at Appen statement in the following code.

IF sy-subrc = 0. "PBS

MOVE lw_tab2592-vbelv TO lw_ekpo-vbeln. "PBS

MOVE lw_tab2592-posnv TO lw_ekpo-posnr. "PBS

MOVE lw_tab2592-vbeln TO lw_ekpo-ebeln. "PBS

MOVE lw_tab2592-posnn TO lw_ekpo-ebelp. "PBS

APPEND lw_ekpo TO lt_ekpo . "PBS

CLEAR lw_ekpo. "PBS

ENDIF.

2)Here internal table is declares as sorted table like this...

tt_ekpo TYPE SORTED TABLE OF tw_ekpo

WITH NON-UNIQUE KEY vbeln posnr,

3)In the same program its have 3 more tables decalred sorted tables as above and also used append.

but its showing dump at one place at APPEND lw_ekpo TO lt_ekpo .

Please let me know wat is the reason for for this..

Thanks & Regards

Manne

1 ACCEPTED SOLUTION

Former Member

you have the reason in your dump "ITAB_ILLEGAL_SORT_ORDER." it comes when you try to append a record in a sorted table which would make the entries out of sequence.

Always use insert table instead of append when you have sorted tables., that will take care of automatic sorting in the internal table.

4 REPLIES 4

Former Member

you have the reason in your dump "ITAB_ILLEGAL_SORT_ORDER." it comes when you try to append a record in a sorted table which would make the entries out of sequence.

Always use insert table instead of append when you have sorted tables., that will take care of automatic sorting in the internal table.

0 Kudos

Hi..

Thanks for your reply..

when iam running the following program iam not getting dump when used append for the sorted internal tables..

REPORT ZTEST_SORTED.

types: begin of tw_vbeln,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

end of tw_vbeln.

*DATA:TT_VBELN TYPE STANDARD TABLE OF TW_VBELN.

data : it_vbeln TYPE SORTED TABLE OF TW_VBELN

WITH NON-UNIQUE KEY vbeln POSNR WITH HEADER LINE .

data : it_vbeln1 TYPE SORTED TABLE OF TW_VBELN

WITH NON-UNIQUE KEY vbeln POSNR WITH HEADER LINE .

.

IT_VBELN-VBELN = '001'.

IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '001'.

IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '001'.

IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '001'.

IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

Iam able to add to the sorted internaltable with non-unique key with out any dump..

kindly look into this and let me know wat is the exact reason for this..

Thanks& Regards

Manne

0 Kudos

You are not getting dump here as the entries in the table are not inserted out of sequence. if you use an out of sequence entry you will get the dump. for example



IT_VBELN-VBELN = '001'.
IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '001'.
IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '002'.
IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.

IT_VBELN-VBELN = '001'.   
IT_VBELN-POSNR = '001'.

APPEND IT_VBELN.  <---- it will dump here

Thats why you need to use Insert statement, in that case SAP will automatically insert the row at the appropriate index to keep the sorted order

former_member181995
Active Contributor
0 Kudos

Read this thread completely =>