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 with Where conditions

Former Member
0 Likes
1,416

Hi All,

I am working on performance issues, where i found like below...

Selection-screen:

s_field1(Optional)

s_field2(Optional)

s_field3(Optional)

Table: XXXX has 3 fields as primary fields

but S_Field1 only using in the where condition. Thats why program was taking long time. If we use like below ...can we imporve performance...

select (fields)

From XXXX

into table itab

where field1 in s_field1

field2 in r_field2

field3 in r_field3.

where r_field2 & 3 are ranges, they will be filled with min & max values.

after that ...we can filter the internal table based on the selection parameters -

will it increase the performance.

thanks

Hi All,

I am working on performance issues, where i found like below...

Selection-screen:

s_field1(Optional)

s_field2(Optional)

s_field3(Optional)

Table: XXXX has 3 fields as primary fields

but S_Field1 only using in the where condition. Thats why program was taking long time. If we use like below ...can we imporve performance...

select (fields)

From XXXX

into table itab

where field1 in s_field1

field2 in r_field2

field3 in r_field3.

where r_field2 & 3 are ranges, they will be filled with min & max values.

after that ...we can filter the internal table based on the selection parameters -

will it increase the performance.

thanks

11 REPLIES 11
Read only

amit_khare
Active Contributor
0 Likes
1,351

this will increase the performance but its not a generic solution.

As an alternative you can read all data from the table and check your condition with READ table statement.

this will definitly improve the performance.

Also check these links-

http://www.erpgenie.com/abap/performance.htm

http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp

Regards,

Amit

Reward all helpful replies.

I hope you are not using any cluster table here.

Message was edited by:

Amit Khare

Read only

0 Likes
1,351

From where i need to read the data, can you let me know more briefly.

thanks

Read only

former_member480923
Active Contributor
0 Likes
1,351

Hi

The Performance will not be increased by much, as per the normal process.. try the following

a) The table has nay Secondary index or not

b) If the Table has no Secondary Index and it is not a Transaction table the best soultion is to create a Secondary Index with the Keys that is in your Where clause.

Hope that Solves the problem

Thanks

Anirban M.

Read only

0 Likes
1,351

To create a secondary index will NOT incrase the performance, because it would be a part of the primary index...

Read only

Former Member
0 Likes
1,351

hi

good

do this things before writing the select satement

1-Sort the internal table

2-Use COOESPONDING FIELDS of statement with the select statement.

Thanks

mrutyun^

Read only

0 Likes
1,351

Into Corresponding fields, to increase performance ? NEVER !

Read only

Former Member
0 Likes
1,351

Hi Jaya,

Your logic will work but try doing this:

1) Declare the other two as select options but hidden.

Ex: Select-options: s_field2/S_field3 NO-DISPLAY.

2) Now the output will have the required format and you need not do the read statement or maintain the data after extraction.

Hope this helps..

BR

Rakesh

PS: Please close the thread if your question is answered..

Read only

0 Likes
1,351

Sorry still, i did not get the satisfactory answer.

thanks

Read only

Former Member
0 Likes
1,351

Hi Jaya Sri,

Try using the below format of select stament ....

<b> Select (fields)

From XXXX

Into table itab

Where field1 in s_field1

and field2 in r_field2

and field3 in r_field3.</b>

<i><b>

Best Regards

Ali S</b></i>

Read only

Former Member
0 Likes
1,351

Hi,

This will work no prob. but no need to fill f_fld2 and s_fld3 bcoz if it is balnk then it will autmatcally select min to max. you can hide this with some no-display option in select options.

Generally, in such cases try to put more where conditions on key field only.

NEVER use into corrosponding fields to fill itab.

what u r going to do, i dont think that will improve performance.

Hope this will help you

Jogdand M B

Read only

Former Member
0 Likes
1,351

Hi,

Performance Issue

There is a very good document on SDN on performance,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef...

Also if you login to the service marketplace and go to the bi infoindex.

http://service.sap.com/bi

there is a performance area where you can download information etc.

One of the best tips I have found that most of these documents will outline in more detail is to buffer the SID Number range objects accessed in table NRIV. Once you find the NRO's that are causing a great deal of reads on the NRIV table you can navigate to transaction SNRO and identify the iobj NRO BIM* to be buffered enter it into the input field and hit change. From the edit menu select Set-Up buffering. From here you can configure the buffering of your iobj SID NRO's.

Of course before going through this process do an SQL trace during the load process to identify whether or not the NRIV table is causing performance issues.

/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops

Rgds,

P.Naganjana Reddy