Application Development and Automation 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: 
Read only

performnace problem when using the view VBAKUK

Former Member
0 Likes
574

Hi All

I have the performance problem when using the view VBAKUK. i am using the query like below.

SELECT VBELN AUART VKORG VTWEG KUNNR

INTO TABLE LT_VBAK

FROM VBAKUK

WHERE ERDAT IN S_ERDAT AND

VKORG IN S_VKORG AND

AUART IN S_AUART AND

VTWEG IN S_VTWEG AND

KUNNR IN S_KUNNR AND

BSTNK IN S_BSTNK AND

VBELN IN S_VBELN AND

VKBUR IN S_VKBUR AND

VKGRP IN S_VKGRP AND

AUDAT IN S_AUDAT AND

GUEEN IN S_GUEEN AND

VDATU IN S_VDATU AND

GBSTK NE 'C'.

and in the selection screen i am passing the values VKORG,AUART,KUNNR and VDATU.

Please suggest me the solution to increase the performance

Thanks

reddy

2 REPLIES 2
Read only

Former Member
0 Likes
407

hi,

1. why are u not passing VBELN value when u have it in select-options. it is the primary key field. It is better u pass that. if u are not passing some of the select-options in to the select query, remove them from the WHERE condition.

2.remove GBSTK NE 'C'. THE inequality operator NE will ignore the index search.

delete the unwanted data based on the condition after the data fetch.

3. make vbeln as the first field in the WHERE condition i.e. put it before ERDAT IN S_ERDAT , just in case

regards,

madhumitha

Read only

0 Likes
407

Hello.

Some advices for your query:

- can at least one of s_vbeln, s_erdat or s_audat be obligatory? The first is the primary key and there are indexes for the other two;

- VBAK has an index named OI0 which is inactive. Considering you are using KUNNR and VKORG, this could be a solution. Just activate, run optimizer statistics and performance will be in shape;

- Madhumitha is right when he says to remove GBSTK NE 'C'. Instead use GBSTK IN ('A','B',' '). Looks the same but for the optimiser is not.

- try to use VBAK and VBUK in an INNER JOIN query, instead of VBAKUK.

Best regards.

Valter Oliveira.