Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to optimize the ABAP select syntax

Dear all:

Anyone can help me to optimize the ABAP syntax like this:

select objid stext from hrp1000

into (itab-plans,itab-plstx)

where plvar = '01'

and istat = '1'

and begda <= pn-begda

and endda >= pn-begda

and langu = sy-langu

and otype = 'S'.

if sy-subrc = 0.

select single * from hrp1001

where objid = itab-plans

and rsign = 'A'

and relat = '008'

and plvar = '01'

and begda <= pn-begda

and endda >= pn-begda

and sclas = 'P'

and otype = 'S'.

if sy-subrc <> 0.

append itab.

clear itab.

endif.

endif.

endselect.

In the table hrp1000 has almost 50000 records ,the table hrp1001 200000 records. I found that if i run the ABAP above ,my performance is so bad .

Andone can help me ?

Tags:
Not what you were looking for? View more on this topic or Ask a question