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: 

Sequential Select fromDB

Former Member
0 Kudos

Hi Experts,

I have a DB with more than 30 million records.

I would like to process the records using the packet size <p_pckt>.

My Requirement is :

I would read the first <p_pckt> records first from the DB.

Then later on when I come to execute the report some other day i would start and processing from <p_pckt> + 1 record in the DB and so on.

Could any one suggest some efficient way of doing it.

Regards

Sandeep

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use SELECT and ENDSELECT with PACKAGE SIZE option.

Each time the database is hit only the given number of records will be fetched and put in the destination.

This will be executed much faster when the database records are very high.

Exmple:

DATA: itab TYPE STANDARD TABLE OF SCARR WITH NON-UNIQUE

DEFAULT KEY INITIAL SIZE 10.

FIELD-SYMBOLS: <FS> TYPE scarr.

SELECT * INTO TABLE itab PACKAGE SIZE 20 FROM scarr.

LOOP AT itab ASSIGNING <FS>.

WRITE: / <FS>-carrid, <FS>-carrname.

ENDLOOP.

ENDSELECT.

Regards,

Rama chary.P

1 REPLY 1

Former Member
0 Kudos

Hi,

Use SELECT and ENDSELECT with PACKAGE SIZE option.

Each time the database is hit only the given number of records will be fetched and put in the destination.

This will be executed much faster when the database records are very high.

Exmple:

DATA: itab TYPE STANDARD TABLE OF SCARR WITH NON-UNIQUE

DEFAULT KEY INITIAL SIZE 10.

FIELD-SYMBOLS: <FS> TYPE scarr.

SELECT * INTO TABLE itab PACKAGE SIZE 20 FROM scarr.

LOOP AT itab ASSIGNING <FS>.

WRITE: / <FS>-carrid, <FS>-carrname.

ENDLOOP.

ENDSELECT.

Regards,

Rama chary.P