Application Development 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: 

Downloading Records in Btaches

Former Member
0 Kudos

Hi Guys,

Can anyody tell how to download the data fronm SAP database in Batches ?I mean like downloading 1st 300,000 rows then again next 300,000 rows like that all the data from database.For Example BSEG table.

Plzz Give me an Example code .

Very Urgent

Thanks,

Gopi

5 REPLIES 5

Former Member
0 Kudos

Hi guys,

Plzzzzzzzzz reply.Can anybody tell what is "Open Cursor" and whats the use of it?

Thanks,

Gopi.

0 Kudos

Hi Gopi,

Basically OPEN CURSOR is like pointer concept / buffer. Most of the times we can see cursors in standard programs, and this is the alternative when internal table could not able hold all the records. I mean when it crosses the 2GB memory space.

Regards,

  • * Dj

reward fro all useful answers.

0 Kudos

Hi DJ,

I was not able to use select statement for BSEG table becoz i was able to get not more than 350,000 if exceed the limit i mean rows i am getting Internal table cannot be extended.

So i thought of downloading the data in sorted order so that by using Account doument number and line item number of last record we can download from there to next 350,000 records but sort doesn't work for BSEG table becoz it is cluster table.

So how to solve this problem.I mean by Open cursor is it possible or not?by using open corsor can we download the data like 350,000 rows chunks?If so how?

plz reply.

Thanks,

Gopi.

Former Member
0 Kudos

Hey Gopi,

Use PACKAGE SIZE addition in SELECT statement. I hope following code will solve your problem.


DATA : it_bseg TYPE TABLE OF bseg,
       v_size TYPE i VALUE '300000'.

SELECT *
  FROM bseg
  APPENDING TABLE it_bseg PACKAGE SIZE v_size.
ENDSELECT.

Reward points if the answer is helpful.

Thankx,

Mukul

0 Kudos

Hi Mukul,

How can we download the next 350,000 rows by mentioning size from what u had wrote the code?

Thanks,

Gopi.