Skip to Content
author's profile photo Former Member
Former Member

Inserting Field in Table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Feb 28, 2007 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 28, 2007 at 03:14 AM

    Check whether the <b>fieldl_1 is NULL.</b>

    inserting-field-in-table

    Hope this quey got answered in the earlier thread.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.