‎2008 May 01 7:06 AM
How to improve the performance while fetching data from RESB table
‎2008 May 01 7:21 AM
hi,
1. Use all the primary key fields in the where condition of your select statement.
2. Do not use joins.
3. Select only the required entries ... rather than selecting all the entries ...
4. Make use of secondary indexes explicitly when using non key fields in your select statements..
Regards,
Santosh
‎2008 May 01 7:57 AM
hi santose,
thank u for ur response.
i have tried but till it takes long time....
‎2008 May 01 7:59 AM
Hi Friend,
Can you Give me the Select Statement That u r using.
Regards,
Suresh Linga.
‎2008 May 01 11:40 AM
hi,
s_matnr ,s_werks are Select-option variables.
IT_RESB is the intermediate table.
SELECT MATNR WERKS BDTER
INTO TABLE IT_RESB
FROM RESB
WHERE matnr IN s_matnr AND
werks IN s_werks .
please give me the correct solution...
Regards
Nihtiyanandam.S
Edited by: Nithiyanandam Somasundaram on May 1, 2008 12:43 PM
‎2008 May 01 12:40 PM
hi,
few suggestions:
1) Check if there is a secondary index on matnr and werks. Probably it will be there.
2) Use the following code to fetch data.
DATA: s_cursor TYPE cursor.
OPEN CURSOR WITH HOLD s_cursor FOR
SELECT MATNR WERKS BDTER
FROM RESB
WHERE matnr IN s_matnr AND
werks IN s_werks .
DO.
FETCH NEXT CURSOR s_cursor
APPENDING
TABLE IT_RESB
PACKAGE SIZE '2000'.
IF sy-subrc <> 0.
CLOSE CURSOR s_cursor.
EXIT.
ENDIF.
ENDDO.
‎2008 May 02 4:04 AM
Hi,
can u tell me
what is the maximum package size .because in resb table having lot of data....
‎2008 May 05 7:44 PM
Hi ~
One small addition - You might be already checking it in the code but just wanted to double check with you.
Check the range s_matnr is not initial before the RESB select query. Otherwise it fecthes all the data from RESB table.
Thanks,
- Srikanth.