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: 

Error: Large table KNA1: No field of a table index in where condition

Former Member
0 Kudos

Hi All,

In my code i have written a statement to select records from KNA1 database table.


SELECT kunnr name1 name2 ort01 pstlz stras stceg FROM kna1 INTO CORRESPONDING FIELDS OF TABLE lt_data

         WHERE stceg <> ''.

I need to select all records which have a VAT number(STCEG).

I am not getting any syntax error, but when i check using code inspector i am getting 'error: Large table KNA1: No field of a table index in where condition'.

How to improve the above syntax to avoid this error?

Thanks in advance,

regards,

NarsiReddy.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

To Avoid this error you will have to pass Kunnr in the selection criteria.

Define a selection options may be . or else you can read the code inspector to find a Pseudocode to remove this error .

Hope this helps.

5 REPLIES 5

Former Member
0 Kudos

Narsi,

As you have already mentioned, the syntax of the select is correct. SAP is suggesting that the select would be of high cost since there is no index that matches your select criteria.

The easiest way is to create an index on the system with STCEG. Please use caution before you approach creation of index as it can potentially slowdown DB inserts.

If there is another way for you to fetch the list of customers and then filter based on STCEG, try following that else run a trace using ST05 and check the cost of the select.

If your requirement states that you have to run the query on KNA1 only using STCEG, then there is no harm creating the index by taking proper measures.

Thanks,

Vikram.M

Former Member
0 Kudos

Hi,

To Avoid this error you will have to pass Kunnr in the selection criteria.

Define a selection options may be . or else you can read the code inspector to find a Pseudocode to remove this error .

Hope this helps.

0 Kudos

Gaurav Dubey wrote:

or else you can read the code inspector to find a Pseudocode to remove this error .

Gaurav,

Suppressing the error message via a  pseudo code does not resolve the issue as such. It only takes out the message from SLIN/code inspector.

Thanks,

Vikram.M

Former Member
0 Kudos

If this is a one time only program, don't worry about it. Just run it in the background and wait.

Rob

Former Member
0 Kudos

HI NarsiReddy,

uh, what`s the number range of VAT number?

Say from 0001 to 9999, then you could use

SELECT kunnr name1 name2 ort01 pstlz stras stceg FROM kna1 INTO TABLE lt_data 

WHERE stceg between '0001' and '9999'.


Regards,

Archer