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

SELECT statement and WHERE condition

Former Member
0 Likes
643

Hi,

I need to select in VBAK where LIFSK = VA or empty.

SELECT vbeln FROM vbak

INTO CORRESPONDING FIELDS OF TABLE gt_item

WHERE auart IN s_auart AND

vkorg EQ p_vkorg AND

( lifsk EQ gc_lifsk OR

lifsk IS NULL ) AND

augru EQ p_augru.

But it comes out as sy-subrc =4.

Or there are several lines with field lifsk empty in table VBAK but no VA.

If I don't put lifsk conditions then it's working.

Can you tell me how to select properly when LIFSK is empty or = VA?

Tarick.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
562

Hi,

try using lifsk = gc_lifsk or lifsk = space.

Regards,

Himanshu

3 REPLIES 3
Read only

ThomasZloch
Active Contributor
0 Likes
562

wrong answer, stick with those below

Read only

Former Member
0 Likes
563

Hi,

try using lifsk = gc_lifsk or lifsk = space.

Regards,

Himanshu

Read only

christine_evans
Active Contributor
0 Likes
562

Blank values in SAP tables are not always nulls; usually they have been defaulted to SPACE which is a string made up of white spaces which is not the same as null....try it with SPACE