‎2008 Mar 13 2:04 PM
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.
‎2008 Mar 13 2:17 PM
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
‎2008 Mar 13 2:11 PM
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.
‎2008 Mar 13 2:16 PM
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
‎2008 Mar 13 2:36 PM
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.
‎2008 Mar 13 2:17 PM
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