‎2009 Jan 08 2:18 AM
Hi,
I am using select statement on IMRG table with measuring point field in where clause. This select included in another select endselect which is a requirement and cannot be avoided.
There already exist a secondary index on this field.
Problem is when i run the program in debugging mode, the select statement works fine but it dumps with time limit error when i run it directly.
Kindly help us what could be done to overcome this issue.
Regards,
Gurmukh singh
‎2009 Jan 08 4:08 AM
Hi,
As the select statement (IMRG) you are using in SELECT ENDSELECT, the problem might be a buffering issue and going to dump.
So in the SELECT ENDSELECT use the PACKAGE option which will read the data in packets and executes the inbetween logic.
Suppose you are getting a 10000 records at one shot using SELECT ENDSELECT, PACKAGE option,
process this 10000 records wherever used and finally clear this 10000 records.
The SELECT ENDSELECT will fetch next 10000 if exists and continues processing.
Regards,
Chitti babu
‎2009 Jan 08 4:08 AM
Hi,
As the select statement (IMRG) you are using in SELECT ENDSELECT, the problem might be a buffering issue and going to dump.
So in the SELECT ENDSELECT use the PACKAGE option which will read the data in packets and executes the inbetween logic.
Suppose you are getting a 10000 records at one shot using SELECT ENDSELECT, PACKAGE option,
process this 10000 records wherever used and finally clear this 10000 records.
The SELECT ENDSELECT will fetch next 10000 if exists and continues processing.
Regards,
Chitti babu
‎2009 Jan 08 7:06 AM
Would recommend to use
OPEN CURSOR SELECT ...
DO.
FETCH NEXT CURSOR.... PACKAGE SIZE 1000.
...
...
ENDDO.
This is better approach to avoid memory issue.
‎2009 Jan 08 7:20 AM
Hi,
I suppose the dump is due to long execution time rather than memory issues . You should use PACKAGE size in case of memory issues rather that Long execution time. Please paste your select query so that we can have a look. Also let us know what is the total no of records in the table to get the size of table.
Thanks
Raj
‎2009 Jan 08 8:41 AM
Hi,
due to performace reason u r program is going to short dump,try to avoide the select and endselect ,if u writing with in the loop for execution it take more time .use another select statement like select single r select up to rows .....
past u select statement ...
Regards,
Madhu
‎2009 Jan 08 1:19 PM
Hi,
Use cursors, ur problem will be resolved. This procedure can avoid using select statements within select-endselect which is performance slow process.
Reason for dump is, you might have fetching huge data from select end select and passing it to inner select using for all entreis, due to memory overflow reason, your program might going to dump.
Please use cursors to avoid this memory problems.
OPEN CURSOR SELECT ...
DO.
FETCH NEXT CURSOR.... PACKAGE SIZE 1000.
if sy-sybrc <> 0.
exit.
endif.
...
...
ENDDO.
‎2009 Jan 08 3:32 PM
@RAM RAM see other positing
same here:
> with time limit error when i run it directly
It is too slow.
Change in batch and you are done.
Or try to optimze it. But if it runs onyl very rarely, then batch is the simpler option.
Siegfried
‎2009 Jan 09 6:04 AM
Hello Guru,
I will suggest you not to use endselect.
select and insert into table itab.
after that you can use read with binary search and loop.
Please send your code so that i can modify accordingly.
i was also getting same issues but i resolved.
Regards,
Sujeet