Skip to Content
author's profile photo Former Member
Former Member

Warning when selecting from RESB

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.