‎2006 Jul 06 6:30 PM
Hi All,
I have a program that updates an infostructure from another by collecting based on certain criteria. But my source has around 2 Million records and uses up a lot of memory. How can i commit the update lets say, for every 25000 records.
And does that release the memory.
Thanks in advance.
‎2006 Jul 06 6:36 PM
hi,
do not update all the records at a time. split them into 5000 records something like that and update the database.
hope this help.
sorry i have understood it differently.
sudheer.A
Message was edited by: sudheer Addepalli
‎2006 Jul 06 6:36 PM
hi,
do not update all the records at a time. split them into 5000 records something like that and update the database.
hope this help.
sorry i have understood it differently.
sudheer.A
Message was edited by: sudheer Addepalli
‎2006 Jul 06 6:38 PM
Well you can use "commit work and wait" statement after each 5000 record. put a counter and inside the if condition use above command.
‎2006 Jul 06 6:39 PM
Gather from the source in smaller chunks (like 25000) and commit the update. Then clear/refresh the internal table.
This will limit the internal table to a byte size of (25000) times (width of record).
Internal table size = number of record X record width
‎2006 Jul 06 8:59 PM
Hi,
I have to modify like in the code below.
And how can i commit for every 25000 records when the situation is as below.
modify s701 from table it_s701 .
if sy-subrc eq 0.
ws_dbcnt = ws_dbcnt + sy-dbcnt.
endif.
modify s701 from table it_zdrr.
if sy-subrc eq 0.
ws_dbcnt = ws_dbcnt + sy-dbcnt.
endif.
modify s701 from table it_zrep.
if sy-subrc eq 0.
ws_dbcnt = ws_dbcnt + sy-dbcnt.
endif.
Thanks again..!
‎2006 Jul 06 9:03 PM
Hi,
Check this :
if ws_dbcnt = 25000 .
commit work and wait
endif.
if you are inside the loop , at the end use commit work.
AT LAST.
COMMIT WORK.
Laxman
‎2006 Jul 06 9:12 PM
Hi Laxman,
But, i wouldn't get the ws_dbcnt untill i get the whole Internal table updated to the DB table. so if it has a million records, i would still be losing on memory.
And i'm not looping in the internal table here, so i can't use the second option either.
Is there any other way to do this ?
Thanks again..!
‎2006 Jul 06 9:18 PM
hi,
Then use 'commit work and wait' after every modify statement.
try this.
Laxman
‎2006 Jul 06 9:23 PM
Use "Commit work and Wait" as i mentioned earlier. it will solve your problem.