‎2008 Jul 04 7:45 AM
hi,
i want to store the entire database table into an excel file on PC.
i try to do that by taking entire database table into internal table and then moving it to a PC using ABAP functions.
but since some tables are heavy the report gives a memory dump while executing the report.
kindly suggest some way out.
one way i can do this is by splitting the database table records into groups..
like
first 1,00,000 entries in one internal table then to file..
refresh table once it has been transfered to file..
next 1,00,000 entries in same table and then append to same file...
refresh again and append.... and so on...
but the problem is how do i find again start from 1,00,001th entry in database table?
please suggest any other way / method/ FM if applicable..
‎2008 Jul 04 8:34 AM
DATA : c1 TYPE cursor
Open cursor usage would solve your problem.
Inside the open cursor u can do a database fetch.. cursor is a temp buffer..
then use the following command to get a package limit of data and process it in chunk.
do
FETCH NEXT CURSOR c1 INTO TABLE itab PACKAGE SIZE p_limit.
enddo
This would solve the memory overflow dump problem
‎2008 Jul 04 8:26 AM
in the select statement, sort the result set by the primary key, so you know the last handled primary key.
‎2008 Jul 04 8:34 AM
DATA : c1 TYPE cursor
Open cursor usage would solve your problem.
Inside the open cursor u can do a database fetch.. cursor is a temp buffer..
then use the following command to get a package limit of data and process it in chunk.
do
FETCH NEXT CURSOR c1 INTO TABLE itab PACKAGE SIZE p_limit.
enddo
This would solve the memory overflow dump problem
‎2008 Jul 04 9:06 AM
Hi.
In addition to the answers given by others I would like to say that you have to be aware of excels 1048576-line limit in Excel 2007. If you are using a older version you are limit to 65536 lines. Is there any reason you need the data in Excel? If you are just doing some calculations it might be easier to do them in ABAP and only export the results.
Best regards,
Jan Stallkamp
‎2008 Jul 04 9:11 AM
Hi,
Open the database in SE16.
Make sure all the columns are displayed.
Then Goto > Download > Save to Spreadsheet
Alternatively use SHIFT + F8
This will help to take a dump of a database in excel sheet.
Thanks
Edited by: Craig Cmehil on Jul 7, 2008 9:08 AM