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.
Showing results for 
Search instead for 
Did you mean: 

optimizing the code for better performance

Former Member
0 Kudos

Dear Frds,

The program performance is getting degraded because of the below select statement which fetches the OBJECTID from CDHDR table for the given period and the T code VA02.

select objectid

from cdhdr

into table gt_itab

where objectclas in lr_objectclas

and objectid in lr_objectid

and changenr in lr_changenr

and username in lr_user

and udate in s_date

and utime in lr_utime

and tcode = 'VA02'.

we have tried with the primary key sequence and also by selecting the distinct data. Still it is taking more time.

Please do needful to tune this for better performance.




Former Member
0 Kudos


did u run this through st05? and are all the values are passed to all the fields in where condition ??? if yes, then imporvement on this select is difficult.



Active Contributor
0 Kudos

Please check SQL trace:


The order of the fields in the where condition is nearyl irrelevant, it is important which inclause are filled

see details in SQL Trace.

Check Explain for this statement to see what index is taken, is it the primary key?

Otherwise come back with duration, executions and records for this select.


Former Member
0 Kudos


replace your where condition by:


OBJECTID = order number.



Former Member
0 Kudos

Hi Reddy!!

Try writing only those fields that u want to put ur conditions on in where condition.

Also are u using ranges that u have used "in" in where condition.

Try "=" option..

Also c to it that u dnt use select query widin loop-endloop.This also degrades the performence....

select * single objectid

from cdhdr

into table gt_itab

where objectclas = lr_objectclas

and tcode = 'VA02'.

Reward if useful.