2007 Jan 10 7:51 AM
Hi Experts,
Below query is giving a warning while doing a syntax check.
SELECT * FROM RESB WHERE RSNUM = CAUFV-RSNUM
AND NO_DISP = SPACE
AND FLGEX NE SPACE
OR DBSKZ = 'F'.
Warning : The field "FLGEX" used in the WHERE condition may contain NULL values.
This warning appears for all selects on RESB table that is an indexed table where selects are done based on AUFPL or APLZL or VORNR or FLGEX.
If only the key fields are used no warning appears and also, the other fields in the above select NO_DISP and DBSKZ give no problem.
They have a customixed secondary index on this table, non unique for columns MANDT and AUFPL.
There is also another INDEX which i think is standard.
Just need your help to find out why this warning appears and is there any solution.
Thanks in advance.
Regards
Raghunahth L
2007 Jan 10 8:13 AM
Hi,
Try to put
SELECT * FROM RESB WHERE RSNUM = CAUFV-RSNUM
AND NO_DISP = SPACE
<b>AND FLGEX NE ''</b>
OR DBSKZ = 'F'.
Dont use space for comparison.
Thanks.
2007 Jan 10 8:30 AM
Hi Justin,
Even I have tried your solution and still the syntax warning appears.
Thanks
Raghunahth L
2007 Jan 10 8:41 AM
Hi,
warning is still acceptable to run your program in sap. however if you dont want the warning to appear, just do the comparison after you selected into an internal table.
furthermore flgex is not a key field for resb, so if you make comparison in the select statement, it will slower your performance when retrieve data from resb.Try put in as much key fields as possible.
2007 Jan 10 8:47 AM
Raghu,
why don't you use INTO clausehere.
try with below code.
SELECT * FROM RESB WHERE RSNUM = CAUFV-RSNUM
AND NO_DISP eq ''
AND ( FLGEX NE ''
OR DBSKZ = 'F' ).
Reward if useful.
2007 Jan 10 2:14 PM
FLGEX can only have two values " " and "X". So change you select thusly:
SELECT * FROM RESB
WHERE RSNUM = CAUFV-RSNUM
AND NO_DISP = SPACE
AND FLGEX = 'X'
OR DBSKZ = 'F'.
Testing for equality is more efficient than using "NE".
Are you sure about your "OR"?
Rob