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: 

Adding records to Sorted table

Former Member
0 Kudos

Hi

I am trying to add records to the sorted table in the LOOP. But run time it is getting dump.

I tried with APPEND and INSERT statments. In both cases getting dump.

Please advise to resolve this.

Thanks in advance.

Rama.

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

Hi Rama krishna,

You may have tried to insert a duplicate entry(With the same key), or you may not have filled all the primary key fields in the sorted internal table.

Regards,

Ravi

0 Kudos

You have to READ TABLE before INSERT to give the index position of the insertion.

Example

READ TABLE t_bkpf WITH TABLE KEY bukrs = bkpf-bukrs

belnr = bkpf-belnr gjahr = bkpf-gjahr

TRANSPORTING NO FIELDS.

CHECK sy-subrc <> 0. " Already in internal table (remove if non-unique key)

INSERT bkpf INTO TABLE t_bkpf.

Regards

Former Member
0 Kudos

hi can you just send that piece of code that is going for dump.

Regards,

srinivas

Former Member
0 Kudos

Hi Rama,

I hope you are not trying to add records to "the" internal table within a loop on "the" same internal table.

I dont know about a dump, but the program will effectively run forever, and if your timeout limit in parameters is really short, it could be the reason for the dump.

Please give us the Short dump ID from ST22.

Tak,

Aditya

Former Member
0 Kudos

HI,

This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Make sure that you are not inturupting the sort sequence of the table, Use the INSERT statmetn with all the keys

Regards

Sudheer