‎2008 Apr 30 1:18 PM
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
‎2008 Apr 30 1:22 PM
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'.
‎2008 Apr 30 1:26 PM
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
‎2008 Apr 30 1:43 PM
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
‎2008 Apr 30 2:08 PM
‎2008 Apr 30 1:39 PM
Hi Great name,
just ignore the warning message and enjoy your report...no probs..
Amit.
‎2008 Apr 30 1:42 PM
Hi,
In my case, it occurred just a warning and the select worked fine.
Regards,
Fernando
‎2008 Apr 30 1:56 PM
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.
‎2008 Apr 30 1:58 PM