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

taking a database table dump in PC

Former Member
0 Likes
1,043

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..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
734

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

4 REPLIES 4
Read only

rainer_hbenthal
Active Contributor
0 Likes
734

in the select statement, sort the result set by the primary key, so you know the last handled primary key.

Read only

Former Member
0 Likes
735

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

Read only

JanStallkamp
Advisor
Advisor
0 Likes
734

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

Read only

Former Member
0 Likes
734

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