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

INSERT Performance

Former Member
0 Likes
1,214

Hello,

What is the most efficient do several INSERT

that is to say make an insert for each line or

using

INSERT <TABLE> FROM <INTERNAL_TABLE>

I have to load a specific table, i use the INSERT from INTERNAL TABLE

but the program is very very long.

When i start to update the table it is always empty.

Thanks for your help

Christophe

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,185

The array insert (from an internal table) will be the quickest way.

Rob

11 REPLIES 11
Read only

Former Member
0 Likes
1,186

The array insert (from an internal table) will be the quickest way.

Rob

Read only

0 Likes
1,185

How many records will you be inserting?

Rob

Read only

0 Likes
1,185

BETWEEN 100 000 and 300 000

i think in developpement there is no data and in integration there is less than a thousand of records.

But the program is still running for more than two hours ....

Read only

0 Likes
1,185

Have you gone to SM50 to see what it's actually doing?

Rob

Read only

0 Likes
1,185

YES AND I SEE NO SQL EVENTS, no DUMP in ST22 as in SM21

Christophe

Read only

0 Likes
1,185

So the problem is likely elsewhere. If the program is not too long, would you post it?

Rob

Read only

Former Member
0 Likes
1,185

1. loop at itab.

INSERT INTO dtable VALUES itab.

clear itab.

endloop.

or

2. INSERT dtab FROM itab[].

Read only

0 Likes
1,185

i load a table by using INSERT dtab FROM itab[].

and the response time is very long .....

I will try to INSERT line by line by i think that using an internal table seems to be the faster solution.

If anyone has a better solution, you're welcome.

My specific table has the same key than KONV and no duplicate are possible.

using a MODIFY can be a solution but i think that it will be slower than INSERT

....

Read only

0 Likes
1,185

No - that will take longer. Try sorting the internal table by the primary key before doing the array insert.

Again - how many records?

Rob

Read only

0 Likes
1,185

The internal table is sorted of course and it's structure is the same than target table.

Read only

Former Member
0 Likes
1,185

Problem is solved

Thank for your help