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

Select query gives error in Code inspector and extended program check

Former Member
0 Likes
1,679

Hi,

I have a query .

SELECT pernr

FROM pa9100

INTO TABLE t_nca_tab

WHERE endda EQ c_date AND

z_nca_required EQ c_yes.

This query gives me an error in Code inspector like :

Large table pa0001: No first field of table index in WHERE condition

I have one more query that gives error in extended program check

SELECT SINGLE stell ename

INTO (g_stell, g_name)

FROM pa0001

WHERE pernr EQ wa_nca_tab-pernr AND

endda EQ c_date.

The warning says:

*In "SELECT SINGLE ...", the WHERE condition for the key field "SEQNR" does not

test for equality. Therefore, the single record in question may not be unique.*

Its too urgent.

Please reply.

Regards,

Binay.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
831

The first one is a performance issue. withou using PERNR in the WHERE, it could take a while to do the SELECT. But if you only have a few records in the table, it won't hurt much.

Rob

4 REPLIES 4
Read only

Former Member
0 Likes
831

use the 'UP TO n ROWS' option.

SELECT stell ename up to 1 rows

INTO (g_stell, g_name)

FROM pa0001

WHERE pernr EQ wa_nca_tab-pernr AND

endda EQ c_date.

ENDSELECT.

Read only

Former Member
0 Likes
831

The first field is PERNR .. so if UR not giving pernr it will fetch

all the data from the said table and between the given dates ..

Check if this is your requirement ...

write the select as ...

where r_pernr is a range ...

SELECT pernr

FROM pa9100

INTO TABLE t_nca_tab

WHERE pernr in r_pernr <----


endda EQ c_date AND

z_nca_required EQ c_yes.

As UR using select single it's expecting to use all the key

fields in the where condition ...

U can ignore this warning message

Read only

0 Likes
831

Hi,

Thanks for your very early reply. For the 1st query I cant use any range for pernr as this query is after a loop at statement where the int. table has no pernr field in it. Any alternative for this case.

Regards,

Binay.

Read only

Former Member
0 Likes
832

The first one is a performance issue. withou using PERNR in the WHERE, it could take a while to do the SELECT. But if you only have a few records in the table, it won't hurt much.

Rob