Application Development and Automation 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: 
Read only

Timed out error - how to avoid it

Former Member
0 Likes
5,563

Hi,

I have created a table control and created a transaction to it. In my report, i use a select statement to retrieve data based on one condition from a table ( which doesn't have any index set ). This works fine. Also, the table control works fine when some small amount of data is retreived and displayed. Problem is when i move this to another server where there is huge data, this transaction which should actually display the data, gives a dump saying that it is TIMED OUT.

Is this timed out error because of my code or the index in the table which is not set?

My code is like this:

First i select records based on a condition.

then i process the records, using Loop, i pass three fileds of every record into a function module to get other data.

Then i take my necessary data using READ statement .

End the loop.

How ever, the loop gets executed the no of times equal to the no. of. records retrieved from the transparent table.

Thanks in advance!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,124

> Creating a secondary index will not affect processing other programs

really, no incorrect .... I definitely influences all changing statements, and it can even influence SELECTS.

Try to select less data for testing, and run SE30 several times => se hitlist what is expensive?

For your LOOP in LOOP or READ in LOOP, use a sorted table for the inner table, it is the same problem as on the DB without index reading is slow.

If DB times are large in hitist, then use SQL-Trace.

Siegfried

> Creating a secondary index will not affect processing other programs

really, no incorrect .... I definitely influences all changing statements, and it can even influence SELECTS.

Try to select less data for testing, and run SE30 several times => se hitlist what is expensive?

For your LOOP in LOOP or READ in LOOP, use a sorted table for the inner table, it is the same problem as on the DB without index reading is slow.

If DB times are large in hitist, then use SQL-Trace.

Siegfried

19 REPLIES 19
Read only

Former Member
0 Likes
5,124

Hi,

In general creating indexes will help you fetch the data from database more quickly.

So try creating index on the table you are accessing.

Varun

Read only

Former Member
0 Likes
5,124

Hi,

Your processing time is more thats why you are getting TIME OUT runtime error.

You need to optimize your code.

Better to debug and observe which logic of the code is taking much time.

If it is SELECT statement then better to use index or provide as many WHERE conditions as possible.

If LOOP is taking time then try to replace that logic with some other approach.

Read only

Former Member
0 Likes
5,124

Hi,

You can create a secondary index on the table field which you are using in "where" condition of your select query.

This will reduce the processing time.

Secondly, you can contact your basis team because they can increase that time out value.

Hope it helps in resolving your problem.

Read only

0 Likes
5,124

If i create an index in the table for the field iam using in WHERE condition in the select query, wont that affect other programs using the table, as it is a major table of my application and is a customized table.

what would be the impact?

How can i avoid loop coz i need to pass 3 field data of each record to a function module to get other data.

Read only

0 Likes
5,124

Hi,

Creating a secondary index will not affect processing other programs.

I don,t think calling a function module in a loop can be avoided because you have to find values for every record in your internal table and if your function module takes only one value at a time .

Read only

Former Member
0 Likes
5,124

Moved to ABAP Performance & Tuning forum...

Read only

Rui_Dantas
Active Contributor
0 Likes
5,124

You should make a trace in SE30 to understand what is taking time to execute.

Is it the data selection? Is it the function module? Is it the READ? .. ?

(and yes, secondary indexes might of course affect other programs)

Read only

Former Member
0 Likes
5,125

> Creating a secondary index will not affect processing other programs

really, no incorrect .... I definitely influences all changing statements, and it can even influence SELECTS.

Try to select less data for testing, and run SE30 several times => se hitlist what is expensive?

For your LOOP in LOOP or READ in LOOP, use a sorted table for the inner table, it is the same problem as on the DB without index reading is slow.

If DB times are large in hitist, then use SQL-Trace.

Siegfried

Read only

0 Likes
5,124

I did run the transaction i have created in se30 and also the function module i am using in the program, in both cases the DATABASE is taking lot of time and not the ABAP or the system.

So is it advisable to set some index for the table?

But as u guys said it would impact other programs and function modules using this table.

Then what am i supposed to do. Is there any alternate so that i can use something in my program only without changing the table or affecting other modules.

Please suggest something.

Thanks!

Read only

Former Member
0 Likes
5,124

run the SQL Trace, it tells you which SELECT or SELECT cause the problem.

The explain tells you which is index is used, check which index is also there, and propose an

index which you would like to create.

Before you create an index, you must answer the question: Which other statement work on that table? Are they much more important than my task? Do they change records?

If they are not more important, then you can create an index, but it needs a bit of experience to know

which order of fields should be taken.

Siegfried

Read only

Former Member
0 Likes
5,124

Since this has been moved to performance and tuning, please see . This will show you the sorts of things you need to look at to help your analysis.

Rob

Read only

0 Likes
5,124

The table that i am using is very important as it is using in many function modules and programs.

First five fields of this table including the field MANDT is the primary key to this table. The field i have used in the WHERE condition of my select query is not one among those fields of the primary key.

So possibly if i create an index, it would impact the other modules. So what should be done ?

If i include one or more field of the primary key fields, would that improve the performance?

Plz suggest! I am badly stuck at this point.

Read only

0 Likes
5,124

Nobody can really help without seeing your actual SELECT statement. Would you post it please?

Rob

Read only

0 Likes
5,124

SELECT NAME_ID

COUNTRY_ID

STATE_ID

REF_NO

APL_CODE

TOT_AMT

UPD_DATE

IL_REF_NO

IL_NAME

IL_DATE

IL_TIME

INTO TABLE LT_TAB

FROM ZDETAILDATA

WHERE IL_REF_NO NE ' ' .

The fields NAME_ID, COUNTRY_ID, STATE_ID, REF_NO including MANDT are the Primary key.

There is no index in the table ZDETAILDATA.

Read only

0 Likes
5,124

I don't think there's much you can do short of re-thinking your process.

Even if you added an index on IL_REF_NO, it wouldn't help because of the NE. Is IL_REF_NO restricted to just a few values?

Rob

Read only

0 Likes
5,124

Huum, bad news for you: an index will not help you if what you want is "NE".

Btw, have you confirmed this query is really the problem? Simple test: go to se16, add the NE ' ' selection in your IL_REF_NO field, and check how long it takes to execute.

Edited by: Rui Pedro Dantas on May 4, 2009 5:47 PM

Read only

0 Likes
5,124

Hi guys,

Thanks for all your replies. I applied sort and Binary search in the code.

Index is not affecting the performance as SELECT is not taking much time.

But i still have the runtime error problem but it is because of the Funtion module i am calling

in the loop. Data overflow is occuring at one field which is an amount field.

Read only

0 Likes
5,124

Hi,

just check the data type of the amount field in the FM and also compare it with the database table.... if its same then paste the code....

if it differs then probably try changing the data type of the FM or try to search for a different FM or check if you can get different logic...

also paste the code so that we can think of an alternative as well...

paste the FM in the loop which you are using and also the structure of the internal table ...

Regards,

Siddarth

Read only

0 Likes
5,124

I cannot change the FM and the field in the FM in which data overflow is occuring is not used in my program code. I have reported the same so probably requirement would be modified.

Thanks for all the help.