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

NULL Value in Select Statement

Former Member
0 Likes
4,319

All;

I have a select statement like below. On Compilation it gives a strange warning message as " The Field ABLAD / WEMPF contained in WHERE condition may contain NULL values".

select-options s_1 for resb-wempf.

select-options s_2 for resb-ablad.

select single * from resb where wempf in s_1 and ablad in

s_2.

Can anyone please suggest how to get rid of this ? Any light thrown on this discrepancy would be greatly appreciated.

Thanks,

Sathya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,675

Hi Sathya,

tables: resb.

select-options s_1 for resb-wempf.

select-options s_2 for resb-ablad.

select single * from resb where wempf in s_1 and ablad in s_2.

If you see the Extended Program check it says that these warnings cannot be hidden.

Messages for Syntax check warnings(Warnings)

Program: ZPPP3 Row: 16

Syntax check warning

The field "ABLAD" used in the WHERE condition may contain NULL values.

Internal Message Code: MESSAGE GYT

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

Program: ZPPP3 Row: 16

Syntax check warning

The field "WEMPF" used in the WHERE condition may contain NULL values.

Internal Message Code: MESSAGE GYT

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

But by using the below code, it is not showing any warnings in EPC...

tables: ebkn.

select-options s_1 for ebkn-wempf.

select-options s_2 for ebkn-ablad.

select single * from ebkn where wempf in s_1 and ablad in s_2.

Note that the Data elements is same in both Tables. Some thing strange with table RESB..

Regards,

Satya

5 REPLIES 5
Read only

Former Member
0 Likes
2,675

Hi Sathya,

Its just a warning and you do not need to worry about that.

Go ahead and activate it.

Regards,

Ravi

Read only

Former Member
0 Likes
2,676

Hi Sathya,

tables: resb.

select-options s_1 for resb-wempf.

select-options s_2 for resb-ablad.

select single * from resb where wempf in s_1 and ablad in s_2.

If you see the Extended Program check it says that these warnings cannot be hidden.

Messages for Syntax check warnings(Warnings)

Program: ZPPP3 Row: 16

Syntax check warning

The field "ABLAD" used in the WHERE condition may contain NULL values.

Internal Message Code: MESSAGE GYT

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

Program: ZPPP3 Row: 16

Syntax check warning

The field "WEMPF" used in the WHERE condition may contain NULL values.

Internal Message Code: MESSAGE GYT

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)

But by using the below code, it is not showing any warnings in EPC...

tables: ebkn.

select-options s_1 for ebkn-wempf.

select-options s_2 for ebkn-ablad.

select single * from ebkn where wempf in s_1 and ablad in s_2.

Note that the Data elements is same in both Tables. Some thing strange with table RESB..

Regards,

Satya

Read only

0 Likes
2,675

Thanks for mentioning about EBKN, which made me better understanding about the settings in RESB table.

Cheers,

Sathya.

Read only

Former Member
0 Likes
2,675

Hi,

I think when we use select single *, In where condition we need to use the fields which are primary keys.

so better use select * from.....

Edited by: Poonam Naik on May 6, 2008 5:19 PM

Read only

vinod_vemuru2
Active Contributor
0 Likes
2,675

Hi Satya,

This may be because of SELECT SINGLE. Use Select single only if u are passing all the keys. If u are not passing all the keys then it may not select the record u r looking for if u have multiple records for the where clause.

Thanks,

Vinod.