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

performance issues?

Former Member
0 Likes
1,119

HI all

i am working on performance improvment.

this is sql stst as below.

SELECT * APPENDING TABLE t_tj02t

FROM tj02t

WHERE istat IN r_status

AND spras = sy-langu.

but it's not giving performance in se30.

how can i replace the for for betterment.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,093

>

> SELECT * APPENDING TABLE t_tj02t

> FROM tj02t

> WHERE istat IN r_status

> AND spras = sy-langu.

the SELECT uses the full key, so this statement could not make any performance issue. There are "only"a few thousands entries in this table (even if r_status is empty), it shouldn't be any problem by this select. Replacing the APPENDING with INTO TABLE makes some sense, but I wouldn't expect a dramatic improvement.

If there is performance issue in your program, it is not because of the above SELECT.

9 REPLIES 9
Read only

Former Member
0 Likes
1,093

Hi,

Try out your query this way

SELECT * from tj02 into table t_tj02t

WHERE istat IN r_status

AND spras = sy-langu.

Hope it helps u out.

Thanks & Regards

Read only

0 Likes
1,093

Hi Ranjit

what about Appending?

Read only

0 Likes
1,093

Hi,

If you use appending it specifies that u r using the statement in your loop.

You use Appending When already u have data in your itab and then yoiu want further rows to be added.

According to my understanding of your requirement you want you data to be collected in an itab without any prior records. So there is no need for using append if this is the case.

Also if possibel try to use other primary keys and indexes in your queries. It will serve u much better.

Hope it helps u.

Thanks & Regards

Read only

former_member226999
Contributor
0 Likes
1,093

How many values you have in r_status? If it is very long then I would advice to get all records from the

tj02t table and then use read table statement to find the value in the internal table. This is faster than having huge list of where clause values. Check out the number of records for your SY-langu... if it is few hundereds then it is ok to read it all in memory.

Hope this helps.

Franc

Read only

ThomasZloch
Active Contributor
0 Likes
1,093

> but it's not giving performance in se30.

What does this mean? Are you sure this statement is causing problems? Is it inside a loop? How many entries does tj02t have?

Thomas

Read only

0 Likes
1,093

Hi Thomos

it means giving the expensive statement

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,094

>

> SELECT * APPENDING TABLE t_tj02t

> FROM tj02t

> WHERE istat IN r_status

> AND spras = sy-langu.

the SELECT uses the full key, so this statement could not make any performance issue. There are "only"a few thousands entries in this table (even if r_status is empty), it shouldn't be any problem by this select. Replacing the APPENDING with INTO TABLE makes some sense, but I wouldn't expect a dramatic improvement.

If there is performance issue in your program, it is not because of the above SELECT.

Read only

Former Member
0 Likes
1,093

Make sure that r_status is not empty.

And don't do this in a loop.

Rob

Edited by: Rob Burbank on Nov 24, 2008 10:16 AM

Read only

Former Member
0 Likes
1,093

> WHERE istat IN r_status

the ABAP statement, where the range comes from, is a useless information! You need to tell

us the database statement as in the detail of the SQL trace or what you see in the debugger, or

what you type in the select-option.

r_status can have any type of condition, not only the empty condition is a problem, it can contain

not equal condition, interval and whatever, oir even combinations of these, all these make the access slower or even really slow!

And don't forget, execute the select twice before you judge the performance, we are not talking about intialization costs.

APPENDING or INTO should make no difference at all, because it has no influence on the statement.

Of course if you do appending, then your internal table contains also the lines of the last select, which has effects on the further processing, but not on the SELECT.

Siegfried