Application Development 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: 

Select Query for VBRK table

0 Kudos

Hi Expert,

Kindly help me to sort this problem,

I am having requirement where I have to pass kunnr from knvv to kunag-vbrk where vbtyp EQ 'M' or 'O',.

where after all entries with knvv , my select query taking much more time to fetch data from vbrk as I know that key field of vbrk is VBELN but for joining knvv I had use kunag.

My code

Kindly help.

Thanks & Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Anand,

You need to narrow your search conditions. Currently you have given condition on sales org only. KNVV will have massive set of data and condition on VKORG only will result into this only.

Check with your functional consultant, whether its possible to put some more conditions on primary keys or not.

Thanks,

Swet

4 REPLIES 4

Former Member
0 Kudos

HI Anand,

You need to narrow your search conditions. Currently you have given condition on sales org only. KNVV will have massive set of data and condition on VKORG only will result into this only.

Check with your functional consultant, whether its possible to put some more conditions on primary keys or not.

Thanks,

Swet

0 Kudos

Hi ,

Try using the secondary index for the field KUNRG but,

check if the switch is enabled.

Former Member
0 Kudos

Did you not check Note 185530 - Performance: Customer developments in SD?

Based on this you should query table VRKPA instead of VBRK when doing a select on customer from VBRK. It will definitely improve the runtime. Don't go for unnecessary secondary index creation. It might have adverse impact on the system.

  1. a) Search for invoices with customer number ("payer") (field VBRK-KUNRG):Incorrect:   SELECT FROM vbrk WHERE kunrg = ...

                       Correct:   SELECT FROM vrkpa WHERE kunde = ...    then SELECT FROM vbrk WHERE vbeln = vrkpa-vbeln

R

0 Kudos

Thanks guys for your help,
Issue is solved as functional given more filters based on FKDAT in VBRK table.
Thanks & Regards.