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

Down Load Data from SAP

Former Member
0 Likes
1,312

Hi All,

I want to download data from SAP in Foreground only. But i have millions of records in Database, because of this Shortdump(Session Expired)is coming.

Is there any other way to download data from SAP in foreground even if we have millions of records.

Thanks in Advance.

Murali Krishna K.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,253

Hi,

extract the data to application server, just collect the data to internal table and pass it to application server.

then once you have the data in application server ,

just use transaction <b>GC3Y</b> to download it to PC.

mention the paths and download.

regards

vijay

12 REPLIES 12
Read only

Former Member
0 Likes
1,254

Hi,

extract the data to application server, just collect the data to internal table and pass it to application server.

then once you have the data in application server ,

just use transaction <b>GC3Y</b> to download it to PC.

mention the paths and download.

regards

vijay

Read only

0 Likes
1,253

Hello Vijay,

If millions of records exist then internal size problem will occur. System will throw dump screen saying

'Further Memory Can Be Allocated. Size Exceeded XXXXXX. Further Lines Cannot Be Appended To Internal Table'.

Regards

Read only

Former Member
0 Likes
1,253

Hello Murali Krishan,

If you are using SE16 for any table download then following can be one of the methods you can try -

1. Get the list of unique values from the table for the primary key using ABAP program probably in ALV or so. Download this list to an excel file.

2. Use only few of the primary keys in SE16 for getting the output. Download can be done easily this time.

3. Next time give the next few primary keys in SE16 and can again download the data.

4. Keep on doing the same until all the primary keys will be done.

This sounds like a bit panic :0(. But can for sure help for downloading the complete data even if millions of record exist in database in SAP.

Regards

Read only

0 Likes
1,253

Hi,

I am not clear.Can you please explain clearly.

Thanks,

Murali Krishna k.

Read only

0 Likes
1,253

hi,

select-options: v_dbcnt like sy-dbcnt.

select * from ztab into itab

where sy-dbcnt = v_dbcnt.

give some 1 lakh first and try like this and store into final internal table each time u get those resords

append lines of itab to it_final.

Read only

0 Likes
1,253

Hello Murali Krishan,

Can you please elaborate your question. What kind of clarity you want?

Also please refer the person to whom you want to ask question. Will be simpler to make out the question then :D.

Regards

Read only

0 Likes
1,253

Hi SAP Developer,

Can you please explain ur answer by using one example.

Thanks & Regards,

Murali Krishna K

Read only

0 Likes
1,253

Hello Murali Krishna,

1. Regarding Dump: That was responded to Vijay in concern with the internal table. (Look for Vijay's comments before my response to him).

-If directly complete data will be taken out of database table containing larger number of records then system throws out via memory dump and/or timeout dump.

-Memory dump is for exceeding the size of internal table and system can't append more lines to internal table.

-Timeout dump is regarding connection to database. If the select query exceeds the defined time of connection then dump occurs.

2. Regarding reading only primary key: This is regarding my first response to your query.

-As the table contains millions of records. That sounds it is item level table. Try to get the header table for the same. Try to get the primary key of the header table

that relates it to item level table.

SELECT PRIMARY_KEYFIELD

INTO TABLE OUT_TAB

FROM HEADER_TABLE

WHERE PRMIARY_KEYFIELD IN BLANK_TABLE.

BLANK_TABLE is a selection table containing only one field of primary key field type. Passing blank table in where clause for primary key will increase the speed of selection query. Here the select statement won't search whole table in absence of any value of primary key rather it will know that primary key is blank and will proceed with next line of database.

-If there is no header table from which you can get the primary key then write select query on the table containing data as follows -

SELECT DISTINCT PRIMARY_KEYFIELD

INTO OUT_TAB

FROM I_TAB

WHERE PRIMARY_KEYFIELD1 IN BLANK_PRIMARYKEY1TAB AND

PRIMARY_KEYFIELD2 IN BLANK_PRIMARYKEY2TAB AND

---

---.

- Try to use all the primary key/indexes in where clause of select query by comparing them with blank selection table for that field.

- After getting the primary keys in internal table, pass this table to ALV and display it on output. Download the result in excel file.

- Use these excel values for the primary key in SE16 transaction. Give first few values and download the data. Then give next few values, again download. Continue till end.

Hope this helps!

Regards

Read only

0 Likes
1,253

Hi SAp Developer,

Thank you very Much for your Help.

Internal Table Fields

Materila Number, Description and Some Other Fileds.

Actually i want to Downd load Material Master Data (Millions Records - Foreground).

I Don't want to Use SE16 and i need every thing thru program only.

Thansk,

Murali Krishna.

Read only

0 Likes
1,253

Hi Chandu,

select * from ztab into itab

where sy-dbcnt = v_dbcnt.

By using this we can down load first 1 lakh records, but if i want to download next 1 lack records How.

Please help me.It is very urgent.

Thanks & Regards,

Murali Krishna K

Read only

Former Member
0 Likes
1,253

Hi Murali Krishna Kakarla,

Use Commit work statement where u use loop in program.

For example:

Loop at ...

Commit work.

Endloop.

This will not give Shortdump(Session Expired) even if u have million of records. Just it will take time according to size of records.

Regards,

Digesh Panchal

Regards,

Digesh Panchal

Read only

Former Member
0 Likes
1,253

parameters: ds(132) lower case.

DATA itab LIKE ZTABLE OCCURS 0 WITH HEADER LINE.

SELECT * FROM ZTABLE
  INTO TABLE itab.
  
open dataset dst for output in text mode encoding DEFAULT.

loop at itab.

  transfer itab to ds.

endloop.

close dataset ds.

Now you have your data in the file name specified in your application server. Now use CG3Y transaction to download the file.

Ps: Reward points if helpful.