Skip to Content
0
Nov 12, 2007 at 03:01 AM

primary key-index-non-primary key

576 Views

Hi Folks,

SELECT VBELN

FKART

VBTYP

VKORG

VTWEG

FKDAT

ERDAT

KUNRG

FROM VBRK INTO TABLE ITAB1

<b> WHERE BUKRS = P_BUKRS AND

ERDAT IN S_ERDAT.</b>

The fields in the where clause are not primary keys,so it is taking time to fetch the data.How can I improve efficiency of the above select statement.

1.loop at itab1.

if itab1-erdat not in s_erdat.

delete itab1.

endif.

endloop.

2.delete itab1 where itab1-erdat not in s_erdat.

Out of the above two which one is efficient.

What if I can't avoid giving non-primary keys in the where clause,can I go ahead and create an index.

Kindly opine.

Thanks,

K.Kiran.