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: 

Fetching Millions of records

Former Member
0 Kudos

Hi Friends,

I have a scenario where the following code is helpful.

DATA: BEGIN OF ztab_int OCCURS 0.

INCLUDE STRUCTURE ztab.

DATA: END OF ztab_int.

SELECT * FROM ztab INTO TABLE ztab_int PACKAGE SIZE 5000.

INSERT z_tab1 FROM TABLE ztab_int.

COMMIT WORK.

ENDSELECT.

But i have a doubt,first time it fetches the data it starts from 1 to 5000 ,but from the next time does it fetch 50001th record to 6000 and so on??

Please help me!

Thanks in adv.

Sandy

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos

Hi sandeep,

yes, first it will fetch 1to 5000 and then 5000 to 10000 like that it will fetch , it depends up on your packet size.

you can check in debug mode also.

in your code you gave 5000, every time it will fetch 5000 records.

Regards

Vijay

Former Member
0 Kudos

Hi sandeep,

1. U are right

2. in second pass,

5001 to 10,000

3. for verifying,

just copy paste this code in new program.

(it will print records from T001

and also will print the Loop Pass Number)

4.

REPORT abc.

DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.

DATA : ctr TYPE i.

*----


selection screen.

PARAMETERS : a TYPE c.

*----


START-OF-SELECTION.

SELECT * FROM t001

INTO TABLE t001

PACKAGE SIZE 5 .

ctr = ctr + 1.

WRITE 😕 '----


Loop Pass # ' , ctr.

LOOP AT t001.

WRITE 😕 t001-bukrs , t001-butxt.

ENDLOOP.

ENDSELECT.

regards,

amit m.