Application Development and Automation 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: 
Read only

code inspector error

Former Member
0 Likes
4,613

Hi ALL

I have got the following error when i am running code inspector,

"Large table SETNODE: No first field of a table index in WHERE Condition"

My code is like below:

SELECT setname  FROM setnode INTO l_bu_name UP TO 1 ROWS

WHERE  setname BETWEEN s_bunit-low and s_bunit-high AND subsetname = l_bu_name.

ENDSELECT.

Thanks in advance.

Regards,

praveen.

8 REPLIES 8
Read only

Former Member
0 Likes
2,189

Check this thread..

& if possible then do not use ENDSELECT, instead use SELECT SINGLE....

Read only

former_member195698
Active Contributor
0 Likes
2,189

This is because your query is not using any Primary/Secondary index.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,189

Hi Praveen

Code inspector does throw this error if we do not use key fields of the large table. I feel its ok because sometime your requirement is to fetch data based on non key field.

Nabheet

Read only

Former Member
0 Likes
2,189

Hi Praveen,

          Yes it is necessary at times to use the non key fields, so the message will be displayed in the code inspector. to hide the message use pragmas/ Pseudo comments in your code.

Regrads,

Umar Syed.

Read only

0 Likes
2,189

thanks everyone for ur reply..umar can u tell me in brief  on how to hide the message,because i am  new to abap.

regards,

praveen

Read only

0 Likes
2,189

Hi Praveen,

          Add inline comment

   "#EC CI_NOFIELD to the select statment. this should hide the message.

Regards,

Umar Syed.

Read only

Former Member
0 Likes
2,189

It's rather brave of some of the replies above to suggest the best approach is to hide this message with a pseudo comment, based on so little context.

In the overall context of your program is it not possible to have either the Set Class or Org Unit available to you when you make the SELECT from SETNODE?  This should be your first investigation.

Regards,

Nick

Read only

0 Likes
2,189

@ Nick

I understand your concern, but use of the key fields was alreaddy suggested in Farid Hasan's and Abhishek's reply

But in some cases it is needed at times to use the non key fields, in such cases code inspector will give you the error.

i know this is not the best approach , but the sugestion was to hide the message, only if it is unavoidable to use non key fields. but first try and use the key fields for selection if possible.

Also agree to the fact that i should have asked for the context of the requirement. Will do so next time.

Thanks and Regards,

Umar