‎2007 Feb 27 7:27 AM
Hi..
I have added a new field FIELD_1 (domain CHAR10) to a already existing Z table, recreated the "Table Maintenance Generator" and transported the table to Test server. Test data exists on test server with some records having FIELD_1 populated and others having FIELD_1 blank.
The following query when executed on test server fetches no records though many records satisfying the WHERE condition exists.
SELECT *
FROM ZDODATA
INTO IT_ZDODATA
WHERE FIELD_1 EQ SPACE.
Also, it should be noted that the below query fetches proper records as expected.
SELECT *
FROM ZDODATA
INTO IT_ZDODATA
WHERE FIELD_1 NE SPACE.
Why does the first query fail to fetch records?
Regards,
Anoop
‎2007 Feb 28 4:04 AM
Hi,
Here f3 is the field added recently.This is giving the results as expected.
data itab type standard table of zzzz_test.
data wa type zzzz_test.
select * from zzzz_test into table itab where f3 is null.
‎2007 Feb 27 9:45 AM
1) for the first query since you are selecting a field whose value is space it does not fetch anything
2) for the second query you are selecting which has some value so it fetch the data
‎2007 Feb 27 1:26 PM
try "regeneration of the table maintenance" again checking all the options that come for deletion.
Ideally there should be no issues in the queries as queries are correct.
‎2007 Feb 27 10:28 PM
Try to replace the first query like
SELECT *
FROM ZDODATA
INTO IT_ZDODATA
WHERE FIELD_1 IS INITIAL.
Hope this helps.
EmJay
-
Assign Points if useful
‎2007 Feb 28 4:56 AM
The Statement
SELECT *
FROM ZDODATA
INTO IT_ZDODATA
WHERE FIELD_1 IS INITIAL
gives syntax error: The operator IS can only be used in "f IS NULL" or "f IS NOT NULL".
However, WHERE FIELD_1 IS NULL serves my purpose.
Thanks & Regards,
Anoop
‎2007 Feb 28 5:06 AM
u can put like this
The Statement
SELECT *
FROM ZDODATA
INTO IT_ZDODATA
<b>WHERE FIELD_1 eq space.
or
WHERE FIELD_1 ne space.</b>
Regards
Prabhu
‎2007 Feb 28 12:17 AM
If the first query is not fetching the records, then it means the records which you think are null, doesn't contain SPACE value in them. Please, check it out by urself wat exactly the value of tht particular field instaed of SPACE. You can definately use INITIAL. try it out.
If solved, then please close the thread.
Thanks
Ashwani
‎2007 Feb 28 3:14 AM
‎2007 Feb 28 4:04 AM
Hi,
Here f3 is the field added recently.This is giving the results as expected.
data itab type standard table of zzzz_test.
data wa type zzzz_test.
select * from zzzz_test into table itab where f3 is null.