Application Development and Automation 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: 
Read only

Adding records to Sorted table

Former Member
0 Likes
3,239

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
Read only

Former Member
0 Likes
1,075

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

Read only

0 Likes
1,075

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

Read only

Former Member
0 Likes
1,075

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

Regards,

srinivas

Read only

Former Member
0 Likes
1,075

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

Read only

Former Member
0 Likes
1,075

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