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

Problem while fetching more records in SAP ABAP report program

Former Member
0 Likes
1,276

Hello Frinds,

I have SAP ABAP report program which fetches data from usr02 table

Now, program is working fine with less number of records, bot in production there are more than 200000 records and either report gets timed out or there is run time error like buffer area not available.

Below is the fetch statement

SELECT bname FROM usr02 INTO TABLE lt_user

So, do I need to take records in small chunks, I do not think it is needed as I have worked on number of othere databases where there are number of records in single fetch statement and database itself take care of this.

Please provide me some approach to resolve this problem.

1 ACCEPTED SOLUTION
Read only

former_member212005
Active Contributor
0 Likes
1,156

This will be very difficult for you.....

Since you are getting a time out error....it looks like, you are runnning this report in foreground....................

Try running it in background it will work...

ELSE....you have to fetch in small chunks....but the question is how will you do it. Since the USR02 only has BNAME as primary key...

Either put the BNAME as part of selection screen and fetch the data.....it will solve your problem....

Only fetch for those BNAME which is entered in the selection screen...

Hope it helps!

Hello Frinds,

I have SAP ABAP report program which fetches data from usr02 table

Now, program is working fine with less number of records, bot in production there are more than 200000 records and either report gets timed out or there is run time error like buffer area not available.

Below is the fetch statement

SELECT bname FROM usr02 INTO TABLE lt_user

So, do I need to take records in small chunks, I do not think it is needed as I have worked on number of othere databases where there are number of records in single fetch statement and database itself take care of this.

Please provide me some approach to resolve this problem.

4 REPLIES 4
Read only

Former Member
0 Likes
1,156

the select statement without a where clause is causing the time out.

if you definitely need all the records you can-

- try using packet size keyword with select statement

- or you can try running the code in background.

Read only

former_member212005
Active Contributor
0 Likes
1,157

This will be very difficult for you.....

Since you are getting a time out error....it looks like, you are runnning this report in foreground....................

Try running it in background it will work...

ELSE....you have to fetch in small chunks....but the question is how will you do it. Since the USR02 only has BNAME as primary key...

Either put the BNAME as part of selection screen and fetch the data.....it will solve your problem....

Only fetch for those BNAME which is entered in the selection screen...

Hope it helps!

Read only

alex_m
Active Contributor
0 Likes
1,156

Hi,

For 2lak record it will take time out based on your production system setting, may be you can run in background or else ask BASIS to extend the time out period. I beleive the first option is the right one.

Read only

Former Member
0 Likes
1,156

Hi,

Always it is suggested to use the where condition if you have some restrictions like specific to country etc.

Now check the internal table structure used whether it is having only single fields bname or not. If not modify it.

Forcefully if you want to restrict the records to some number, then you can use the addition of up to XXX rows.

Regards,

Santhosh.