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

buffer usage on select statments.

Former Member
0 Likes
651

Hi,

There are many standard SAP tables where total row count is in crores. So for these table, if we give abap statement as "select * from tablename" then I want to ask if there will be any buffer issues. I have tried to limit rows by giving statement "select * from tablename where rowid" but unfortunately there is no rowid option available with select statement.

So I would like to ask if there is any other way to avoid any possible ABAP dumps due to buffer related issues when we give "select * from" command.

Please advise.

Regards,

Santosh

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
626

It depends , how many records you wnat to fetch.

You can avoid the buffer isues by using OPEN CURSOR technique or didvide the select based on package size .

Read only

0 Likes
626

for crores of records u will ofcoz get dump without giving key elements in where statement..

try package size and giving primary keys.

Only if the table is a buffered table that will reduce hitting database all the time. chk what is the type of the table in technical settings.

Read only

Former Member
0 Likes
626

Hi

As a good programing standard, we try to avoid the *'SELECT * FROM <table_name>'* statement. Insted we specify only the fields which are required in the application.

Secondly, the condition specified in the WHERE clause should be such that the number of records retrived is not very large.

We can also make use of DISTINCT addition in SELECT so as to select only the non repeated records.

And ARRAY FETCH is should always be prefered over SELECT SINGLE in a situation wherein more then one recors are to be fetched from same table but used at different locations in the same application.

Hope this helps you.

Regards

Gaurav.

Read only

Former Member
0 Likes
626

In Case of retrival of data from Database , it is always good to go in with a predetermination as the scope of the requirement might be .

Generally the data retrival is based on certain specific criteria based on certain fields of a table , by this only the required fields are selected , secondly the where condition can be used as an additional line of filtering of the required records . If after the 2 successive filtering still the data required is increasingly large then 2 internal table's can be used with 2 select queries for retrival with a retrival criterion change .

Eg . Select Statement 1 From Comp Code 1 where cond --1 lk entries

Select Statement 1 From Comp Code 2 where cond --1 lk entries .

By this means even though there will be a double fetch but the retrival at any particular instant would not exceed an optimum so as to cause a buffer problem .

Regards