‎2009 May 28 11:20 AM
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
‎2009 May 28 11:34 AM
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 .
‎2009 May 28 11:37 AM
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.
‎2009 May 28 11:42 AM
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.
‎2009 May 28 1:22 PM
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