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

commit each record in loop v/s bulk commit

former_member599326
Participant
0 Likes
1,377

Hi,

I have query. Which option gives best performance ?

Option 1 :- Committing record in loop per row.

Option2 :- Commit after loop, entire table in one go i.e. bulk commit.

e.g.

option1

LOOP AT it_mis INTO wa_mis.
INSERT z_mis_his FROM wa_mis .
COMMIT WORK.
CLEAR wa_mis.
ENDLOOP.

option 1

LOOP AT it_mis INTO wa_mis.
INSERT z_mis_his FROM wa_mis .
CLEAR wa_mis.
ENDLOOP.

COMMIT WORK.

5 REPLIES 5
Read only

FredericGirod
Active Contributor
1,281

make a trace, using transaction SAT for example, and you will find your answer.

(this problem is already known and discussed in IDOc integration)

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,281

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,281

I think it's more a question of ensuring database integrity. It's more critical than performance!

Read only

ThorstenHoefer
Active Contributor
0 Likes
1,281

Hi santosh.b2,

for a bult insert, I would use

insert z_mis_his FROM table it_mis .
Read only

former_member808116
Participant
0 Likes
1,281
insert z_mis_his FROM value wa_mis .