2008 Aug 05 6:15 AM
Array Insert VS Single row Insert
LOOP AT IT_TAB INTO WA_TAB.
INSERT INTO CUSTOMERS VALUES WA_TAB.
ENDLOOP.
VS
INSERT CUSTOMERS FROM TABLE IT_TAB.
2008 Aug 05 6:20 AM
Hi,
INSERT CUSTOMERS FROM TABLE IT_TAB. is always better.
Try avoiding insert database table statement inside a loop.
Rewards if useful.
Regards,
Nishant
2008 Aug 05 6:20 AM
Hi,
INSERT CUSTOMERS FROM TABLE IT_TAB. is always better.
Try avoiding insert database table statement inside a loop.
Rewards if useful.
Regards,
Nishant
2008 Aug 05 6:23 AM
Hi,
INSERT CUSTOMERS FROM TABLE IT_TAB.
Is the best way to insert into datbase table as its 1 shot hit to database.
Performing any operation inside LOOP is always a performance bottleneck.
So insert in a LOOP -- ENDLOOP is not preferred.
Hope this helps you.
thanx,
dhanashri
2008 Aug 05 6:24 AM
Hi,
In case of Inserting Single record through work area
hiting of Databse equals to number of Records in the internal table.So here database access is more.
But if you Insert records through Internal table at a time it access the database for a single time , so the database load is decreasing.
So Performancewise Inserting Records through Internal table ie better.
Regards,
Sujit
2008 Aug 05 6:24 AM
Deepa,
Avoid unnecessary MOVEs by using the explicit work area operations
LOOP AT IT_TAB INTO WA_TAB.
INSERT INTO CUSTOMERS VALUES WA_TAB
where appropriate.
For more infor use SE30>Tips and trick you will find yourself more close to this topic.
Amit.
2008 Aug 05 6:26 AM
hi,
Using INSERT inside a LOOP ENDLOOP statement will give you a very bad performance.
Use INSERT without LOOP ENDLOOP statement for better performance.
Regards
Sumit AGarwal
2008 Aug 05 6:26 AM
Hi,
Use second option becoz it reduce the no of hits from database to insert the new records.
2008 Aug 05 6:27 AM
Hi Deepa,
INSERT CUSTOMERS FROM TABLE IT_TAB is the better option.
Coming to insertion into database, it is not recommended to use INSERT statement, as the database tables are populated using screens, where all the validations and authorizations are done. Whereas INSERT can insert into table without these validations also.
Regards,
Chandra Sekhar
2008 Aug 05 6:30 AM
Hi Deepa,
use INSERT CUSTOMERS FROM TABLE IT_TAB.
It is much better performance wise as the database is hit only one time as copmared o loop/emndloop which results in multiple access thereby decreasing performance.
Regards,
Sachin.