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: 

Expensive statement on DB

Former Member
0 Kudos

Hi,

The following statement is expensive on the database. Kindly provide me the certain change to improve the performance.

refresh i_hrp1000.

select objid begda endda mc_short from hrp1000 into table i_hrp1000

where plvar = c_plvar

and otype = c_otype

and istat = c_istat

and langu = sy-langu.

Rgs

Krishna

3 REPLIES 3

former_member156446
Active Contributor
0 Kudos

if you can use all the below fields in your select it would be more effeciant:

PLVAR OTYPE OBJID ISTAT BEGDA ENDDA LANGU SEQNR, these are the primary keys

Former Member
0 Kudos

check the below FM

RH_READ_INFTY_1000

Former Member
0 Kudos

Hi Krishna,

try to add additionla parameters and set some default values to minimize the select statement.


    select single
           objid begda endda mc_short
           from hrp1000
           into l_pdesc
           where otype = c_otype
           and objid = pernr-plans    "<<  pass this
           and istat = '1'                  "<<pass this
           and begda le sy-datum   "<<pass this
           and endda ge sy-datum.  "<<pass this

Regards,

Prabhudas