06-02-2006 3:50 PM
Hi to all
I need help. I am running an ABAP program, and I get the following short dump: this error is "Time limit exceeded"
the program "Zxxxxxx" has exceeded the maximum permitted runtime and has therefore been terminated.
how i can fix the problem?
The struct of code is:
SELECT
field 1
field 2
.....
Field n
INTO
IT_KNA1_1
IT_KNA1_2
......
IT_KNA1_n
FROM
KNA1 AS x INNET JOIN
WHERE
Field_1 EQ Field_X
AND Field_2 EQ Field_y
....
the problem is here -> AND Field_n EQ Field_tAPPEND it_kna1_x
END SELECT
Thanks an any answers.!! this problem is hardware or optimization code select?
please help me.
06-02-2006 3:53 PM
Hi,
WELCOME TO SDN
Time out error usually appears if there are many records in the production server . Try using <b>FOR ALL ENTRIES</b> statement.
Regards,
Santosh
Reward Points if it helps
06-02-2006 3:54 PM
06-02-2006 3:54 PM
Hi Xabier,
Modify your code as follows:
data: begin of it_kna1 occurs 0,
field1 like kna1-field1,
field2 like kna1-field2,
field3 like kna1-field3,
end of it_kna1.
select field1
field2
field3
from kna1
into table it_kna1
where field1 = p_field1
and field2 = p_field2.
REgards,
Ravi
06-02-2006 3:55 PM
Hi,
This is SELECT statement issue. You SELECT statement is getting so many rows for the selection criteria you have given that with in the specified limit, its unable to handle the same.
SELECT directly into the table without ENDSELECT might help a little bit.
Regards,
Ravi
Note :Please mark the helpful answers
06-02-2006 3:55 PM
You are doing a select statement probably without any indexed search. You also have a SELECT ... ENDSELECT which means you introduced a loop. These are causes for extremely long execution times. You need to change your code to reduce it. Can you post your actual code here so that we can finetune it to run faster?
One suggestion is that instead of a SELECT ... ENDSELECT, try to move all the records into an internal table in one single shot with the INTO TABLE itab option.
06-02-2006 3:58 PM
hi,
put a break point at that line and try to debug the program u will find exactly what is happening there
may be here main problem is your program is unable to verify all the condition what ever u gave in the select statement just review it
instead of select endselect use the into table in select statement
i think it would be helpful for u
Regards,
Naveen
06-02-2006 3:58 PM
hii ,
A commit work will reset the time-out counter .
Place it before select statement..
use <b>for all entries</b> .
Before using FOR ALL THE ENTRIES statements, check the internal table is not initial (if IT_KNA1 IS NOT INITIAL), else it will select for all the records.
i guess you need to optimize your code..so paste your code so that we can try to optimize it .
use FM <b>sapgui_progress_indicator</b> - this will exceed your time limit .
Dont write the code between select ..end select .
select directly into internal table .
make sure you follow this :
<b>Consolidated selections
No row by row processing
No check statements
No selections within loops
Selections are 'into' internal tables - no appends
SQL trace check completed
All programs checked to make sure that they are using the full index and in the
Correct order.
Minimum or zero number of identical selects.
Use of appropriate Indexes</b>
Regards
Naresh
06-02-2006 4:02 PM
hi mickel.
welcome to SDN.
this is due to the poor code.
please remove the endselect variant and use INTO TABLE addition to your select statment..
for eg.
tables mara.
data: begin of itab occurs 0,
matnr like mara-matnr,
erdat like mara-erdat,
end of itab,
begin of itab2 occurs 0,
matnr like mara-matnr,
maktx like makt-matkx,
end of itab2.
select-options s_matnr for mara-matnr.
start-of-selection.
select matnr erdat from mara into table itab
where matnr in s_matnr.
if not itab[] is initial.
select matnr maktx from makt into table itab2 for all entries in itab where matnr eq itab-matnr.
endif.
Cheers,
Abdul Hakim
Mark all useful answers..