Skip to Content
0
Former Member
Jul 18, 2012 at 05:08 PM

Query on BKPF~Index

185 Views

Hi Friends,

I've a select query as below:

SELECT bukrs belnr gjahr cpudt cputm awtyp awkey
INTO TABLE gt_bkpf FROM bkpf
WHERE bukrs = P_BUKRS
AND cpudt IN r_cpudt
AND bstat = space.

if I keep the select query as it is, it hits the index BKPF~5. I need to add one more condition in the select query i.e. AWTYP = 'VBRK'.

Now I've 2 options:

1. Either I keep the select query as it is & delete the internal table GT_BKPF separately.

2. Or I modify the select query as below:


SELECT bukrs belnr gjahr cpudt cputm awtyp awkey
INTO TABLE gt_bkpf FROM bkpf
WHERE bukrs = P_BUKRS
AND cpudt IN r_cpudt
AND bstat = space

AND awtyp = space.

I just wanted to confirm that which option is better. BKPF~5 contains only 3 fields : BUKRS, CPUDT & BSTAT.

So, which option is better I should go ahead with? If I go with the select query in the option 2, will it still hit the index. In my opinion option 1 is better but I needed a second opinion.

Please advise.

Thanks