‎2008 Jul 03 7:16 AM
Hi,
I have developed a new report.When I check the code inspector it is showing 15 errors all for the same select statement.The error is 'No first field from table index in WHERE condition'
Why do we get this error.What can be done to remove this error.
‎2008 Jul 03 7:21 AM
Hi
it would be good if u can put the select statmt that is giving the error...
‎2008 Jul 03 7:29 AM
Hi,
I am giving the select statement i used in the program.
SELECT ryear runit poper
rbukrs activ refdocnr refdocln
werks matnr lifnr bwart
INTO TABLE gt_glpca
FROM glpca
WHERE rbukrs = p_rbukrs
AND werks IN s_werks
AND lifnr IN s_lifnr
AND poper IN s_poper
AND ryear IN s_ryear
AND activ = c_rmwa
AND bwart = c_411.
In glpca table,key field is gl_sirid.but this is not having any value.So I can't use this in the where condition.Can u suggest some solution for this?
‎2008 Jul 03 7:23 AM
This is because you have not used any key fields( primary or secondary indexes) in your WHERE condition of that SELECT statement.
If it is functionally viable to add any of the key fields, then you might not face this error.
regards,
madhu
‎2008 Jul 03 7:31 AM
Hema,
Code Inspector
Analysis of the WHERE condition for SELECT
Table xyz: In the WHERE condition, there is no first field of a table index.
The current SELECT statement can probably not be processed using an index because the WHERE condition does not contain any first field of a table index (or index fields only with the addition NOT or the relational operators NE or '<>').
The whole database table therefore needs to be searched through, which can lead to long response times.
Check whether the WHERE condition can be reformulated to match a table index.
Check whether an additional table index can be created.
TIP: You can do this
The priority of the message depends on the size category of the table:
Size category 0, 1 => Warning
Size category >= 2 => Error
The message can be suppressed using the pseudo comment "#EC CI_NOFIRST
‎2008 Jul 07 12:23 PM
hi Hema,
When u are selecting from table check for the key for that <b> table </b>
in where condition more number of primary keys must be used to efficient data fetching,
in your case you might be <b> not using the primary key or index field of the that table </b>
amit
‎2008 Jul 07 12:43 PM
The fields u have used in Where conditions are not primary keys..
thats y its giving such a error
‎2008 Jul 07 2:00 PM
Check with SE16, the number of entries in the GLPCA in your system.
If large then you have a problem.
There is a number of indexes on this table. And you need index support for fast procesing.
An index can only be used if you use the fields from the beginning.
The code inspector check only simple things whether there is at least a first field of an index.
In fact you need selective fields.
Siegfried