Application Development 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: 

Warning when selecting from RESB

Former Member
0 Kudos
661

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

5 REPLIES 5

Former Member
0 Kudos
217

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.

0 Kudos
217

Hi Justin,

Even I have tried your solution and still the syntax warning appears.

Thanks

Raghunahth L

0 Kudos
217

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.

Former Member
0 Kudos
217

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.

Former Member
0 Kudos
217

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