Skip to Content
0
Former Member
Sep 03, 2013 at 04:42 PM

How to improve this query's performance?

40 Views

Hello,

I have the following query that can take 5+ mins to run in our QNA system. This is unacceptable for our users (generally nothing should take longer than 1 min to run as this query is used in a RFC for a web application). I have worked with our DBA to add indexes to the VBPA-LIFNR field as well as the VBAK-ANGDT and BNDDT fields. Neither of these changes has caused a significant improvement in performance.

Any ideas on how to perform this query in a quicker way would be much appreciated.

The purpose of this query is to grab the sales quotes (along with some additional data) that are still valid, open, and unshipped for a particular carrier.

"select for partner table with default entry 000000

SELECT A~VBELN AS RELEASE_NUMBER A~POSNR AS ITEM_NUMBER A~WERKS

A~ARKTX AS MATERIAL_DESC A~KWMENG AS QUANTITY A~VRKME AS UNIT A~ZZAGRIUMPO AS PO_NUMBER B~LIFNR

INTO CORRESPONDING FIELDS OF TABLE ITAB_RELEASE

FROM VBAP AS A INNER JOIN VBPA AS B ON ( B~VBELN = A~VBELN AND B~POSNR = 000000

AND B~LIFNR = P_CNUMBER AND B~PARVW = 'C1' )

INNER JOIN VBAK AS C ON C~VBELN = A~VBELN

INNER JOIN VBUP AS D ON D~VBELN = A~VBELN AND D~POSNR = A~POSNR

WHERE A~ABGRU = ''

AND ( C~ANGDT <= SY-DATUM

AND C~BNDDT >= SY-DATUM )

AND D~GBSTA = 'A'.

Thanks,

Mike