Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error Time limit excedeed

Former Member
0 Kudos

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.

8 REPLIES 8

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

dont use inner join

use <b>FOR ALL ENTRIES</b>

former_member181962
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

abdul_hakim
Active Contributor
0 Kudos

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..