Skip to Content

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

Improving query performance

Hi,

This piece of code is taking a long time and many times gives Abap runtime errors with SYSTEM_IMODE_TOO_LARGE. (Basically the performance of the query needs to improve. I have done ST05 and also ran the query and I would appreciate any input on improving performance. I have put my comments in brackets after every query.

SELECT vbeln auart audat kunnr qmnum vkbur

FROM vbak

INTO CORRESPONDING FIELDS OF TABLE t_vbak

WHERE vbak~vkorg IN s_vkorg

AND vbak~audat IN s_erdat

AND vbak~kunnr IN s_kunnr.

(The above query is fine. Returns about 80,000 rows)

CHECK sy-subrc EQ 0.

  • Select VBAP

SELECT erdat matnr posnr pstyv vbeln arktx werks abgru

FROM vbap

INTO CORRESPONDING FIELDS OF TABLE t_vbap

FOR ALL ENTRIES IN t_vbak

WHERE vbeln = t_vbak-vbeln.

(The above query takes a long time to execute)

t_vbap_ra[] = t_vbap[].

(The above statement takes a long time to execute)

DELETE t_vbap_ra

WHERE pstyv <> 'ZRRA' AND

pstyv <> 'ZWRA'.

(This statement takes a long time to execute)

Thanks

Ram

Former Member

Helpful Answer

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