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: 

Which is best way to update DB table

Former Member
0 Kudos

Hi Guru's,

I wanted to know which is the best way to update the database table entries from performance point of view?

Using MODIFY is it a performance issue ?

Regards ,

Praveen

6 REPLIES 6

former_member194613
Active Contributor
0 Kudos

yes!

The fastest way are array update.

So you should try to determine what must be updated and what must be inserted.

Then do



insert db_tab from table itab_ins.

update db_tab from table itab_upd.

Modify is more convenient, but line-oriented. Useful for small number of updates.

For very large numbers of update you should plan a commit after about 10.000 records. Take care that the data remain consistent.

Siegfried

0 Kudos

Hi Siegfried Boes ,

I am replacing the old profit center of order number with new one using modify statement and i am using commit work after that .

I heard that using the Modify statement for Db table will not be good instead we should look for some FM to update .

Please can u suggest me what are negative points for using MODIFY statement from performance point of view .

Regards ,

Pravee

Former Member
0 Kudos

Hi,

1. Create FM for Update The Data

- Processing Type = Update

2. Call FM from 1.

- Addition parameter "IN UPDATE TASK"

- Pass Data

3. after that COMMIT WORK

Former Member
0 Kudos

hi...

Insert table.

this is the bests way from performance point of view as well.

It will directly insert entries in the table and will give a dump in case of duplicate entires

Former Member
0 Kudos

Hi,

If it is a standard SAP table you should use BAPI or BDC.

For a Z table, update is better than modify statement from performance perspective. Modify will check first and then do insert or update, so it's an extra work.

-Regards

Ashim

former_member194613
Active Contributor
0 Kudos

is it so difficult to understand my answer,

modify tries to update and if the record is not there then it inserts one.

For mass changes it is better to determine, what must be updated and what inserted and do it separately with 'update/insert dbtab from itab'.