Skip to Content
0
May 12, 2008 at 09:53 AM

Performance issue

25 Views

Hi Guys,

I am trying to find out whether any sales order has been created for particular customer in past 6 months. I am writing below query. But it is taking toomuch time for input of around 900 customers. Is there any other way to improve the performance/to know whether sales order is created in past 6 months for a customer.

SORT i_tab BY kunnr.

DELETE ADJACENT DUPLICATES FROM i_tab COMPARING kunnr.

CHECK NOT i_tab[] IS INITIAL.

SELECT vbeln erdat kunnr

INTO TABLE i_vbak

FROM vbak

FOR ALL ENTRIES IN i_tab

WHERE kunnr EQ i_tab-kunnr

AND erdat GE l_date.

l_date contains 6 months past date.

Thanks,

Vinod.