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 not working

Former Member
0 Likes
672

Hi All,

We are facing an issue while performing a fetch from one our Z table.

We have several fields like Mantr , matkl ..etc with this we have one field for check box having values 'X' or ' '..But we are not getting the records,it is givng subrc = 4.

SELECT * INTO TABLE gt_yabc  FROM yuudf  WHERE gid = p_id
                                 AND vstel  = p_vstel
*                                AND aedat IN s_aedat
*                                AND aedat NE '00000000'
                                 AND statdat IN s_stadat
                                 AND statdat NE '00000000'
                                 AND confflag = p_confl
                                 AND ( status EQ 'A'
                                     or status EQ 'R' )
                                 AND delflag = ' ' 
                                 AND matnr IN p_matnr
                                 AND EU_STOR_REL =  ''.( problem is here)

they are several records having EU_STOR_REL as empty, but we are not getting records from above query , if we remove last condition ie EU_STOR_REL = ''. then records are getting selected.

Can anyone help on this.

Regards

CB

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
625

I assume that column EU_STOR_REL was added later to the existing table and now has NULL values in the existing rows as opposed to initial values.

If this is the case, you can try checking the "initial values" flag for the field in SE11, transport again and adjust the table via SE14 (if not done automatically by the import).

Thomas

4 REPLIES 4
Read only

Former Member
0 Likes
625

Hi,

Instead of trying like this AND EU_STOR_REL = ''.

try like this EU_STOR_REL IS INITIAL.

It should work. Otherwise please revert the problem.

Thanks and regards.

Aswath.

Read only

0 Likes
625

Another way

remove AND EU_STOR_REL = ''.( problem is here)

After selection delete table ...where EU_STOR_REL = ' '

Read only

ThomasZloch
Active Contributor
0 Likes
626

I assume that column EU_STOR_REL was added later to the existing table and now has NULL values in the existing rows as opposed to initial values.

If this is the case, you can try checking the "initial values" flag for the field in SE11, transport again and adjust the table via SE14 (if not done automatically by the import).

Thomas

Read only

0 Likes
625

Hi Tomas ,

Yes your guess is 100% correct , we have to check the "Initial Value" check box in SE11 , the issue has been solved and points also awarded ..

Thanks a lot for valuable help.

Regards

CB