My internal table contains material in lakhs.After fetching the record from database table MARA,i process each material to find out its characteristics.As there are too much records it is taking time, resulting in time out error abap dump. If i want to process first 5000 material then remaining 5000 and so on...what logic should i apply?or can there be any alternative solution?
Please find my suggestions.
1>Have a parameter field in the selection screen for "NO OF records"...so while retrieving data from mara you can select upto the <No of records> specified in the selection screen.
2>Specify the materials in the selection screen to get lless records.
3>Run the report in background and check the output.
You can also check if the read statement has BInary Serach.
By Adding this it will improve performance.
Read statement will occupy lots of time to read the records.
Sort the Internal table with some key field and the use Binary Search for an internal table.
SORT T_PRGEN by ATTR20A.
READ TABLE T_V_TCAV201 INTO WA_V_TCAV201 WITH KEY ATTRV20 = WA_PRGEN-ATTR20A BINARY SEARCH.
This should fix the issue.