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

syntax error

Former Member
0 Likes
1,660

SELECT baugr

FROM resb

INTO TABLE it_resb

FOR ALL ENTRIES IN it_afko

WHERE rsnum EQ it_afko-rsnum AND

werks = 4090 AND

bwart = 216.

i m getting error as below:

The field bwart used in the where condition may contain null values

8 REPLIES 8
Read only

Former Member
0 Likes
1,368

Try this


SELECT baugr
  FROM resb
  INTO TABLE it_resb
  FOR ALL ENTRIES IN it_afko
  WHERE rsnum EQ it_afko-rsnum 
    AND werks = '4090'
    AND bwart = '216'.

Read only

0 Likes
1,368

HI that is not syntax error it is a warning message.even i used the code which u provided it is giving the same thing

Read only

0 Likes
1,368

If the database table field contains the value NULL, the evaluation of the condition is neither "true" nor "false", but "unknown". Here this table RESB contains NULL values for BWART field. Hence that is the warning message you have got.

Check out below help for SELECT statement:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm

Here it says that - The conditions cond in the WHERE clause are often like logical expressions, but not identical, since the syntax and semantics follow that of Standard SQL. In the conditions in the WHERE clause, you name columns using a field name as in the SELECT clause. In the following descriptions, s always represents a column of one of the database tables named in the FROM clause.

The result of a condition may be true, false, or unknown. A line is only selected if the condition is true for it. A condition is unknown if one of the columns involved contains a null value.

I hope it helps.

Best Regards,

Vibha

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 30, 2008 5:53 PM

Read only

0 Likes
1,368

hI,

REFER NOTE 1088403 FOR MORE DETAILS.

THANKS,

Read only

Former Member
0 Likes
1,368

Hi Great name,

just ignore the warning message and enjoy your report...no probs..

Amit.

Read only

Former Member
0 Likes
1,368

Hi,

In my case, it occurred just a warning and the select worked fine.

Regards,

Fernando

Read only

Former Member
0 Likes
1,368

Hi,

When u r using For All Entries, the pre-requisites you need to check is, first sort the Internal Table you are using f or For all entries and secondly this Internal table should be checked for not initial. Then you can avoid such errors and also use single ' ' for char.values.

sort it_afko[].

If not it_afko[] is initial.

SELECT baugr

FROM resb

INTO TABLE it_resb

FOR ALL ENTRIES IN it_afko

WHERE rsnum EQ it_afko-rsnum AND

werks = ' 4090 ' AND

bwart = ' 216 '.

Regards,

Reena.

Read only

Former Member
0 Likes
1,368

Please close the thread if your query is solved.