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

How to replace NULL value in a table after creation

Dear all,

We added an include to the table EKKO containing several fields including ZZTYPC.

The initialization flag was not set at creation time so the new fields were populated with the NULL value.

We would like now to initialize the value for all the records of the field ZZTYPC to avoid problems when we use this field as a selection criteria in Tx SE16.

As suggested in the following post

issue-when-few-fields-were-added-to-a-custom-table

I checked the initilization flag for this field at the structure level (Dictionary : Display structure), save & activate but the modification is not carried over the table EKKO : the "initial values" check box stays unchecked for the field ZZTYPC thus the adaptation of EKKO is useless.

We use DB2 as database.

You help would be appreciated.

Best Regards,

Olivier

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2010 at 06:36 AM

    Hi Olivier,

    Please try to put values in all the records of ZTYPC field. Once all the records are filled with some values apart from null, then try to check the initialization check box in Maintain table screen.

    Hope this will work.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 05, 2011 at 02:06 PM

    I just ran into this problem as well. I added an append structure to REGUH, you can not check the initial value column.

    What I found was the new field on existing records contained a null value and on new records it was set to initial.

    What I did (in test) is write a program that changes all records where the new field = NULL to inital date.

    DATA: init_date LIKE reguh-zzextrd,

    init_time LIKE reguh-zzextrt.

    CLEAR: init_date,

    init_time.

    UPDATE reguh

    SET zzextrd = init_date

    zzextrt = init_time

    WHERE zzextrd IS NULL.

    Jerry

    Add a comment
    10|10000 characters needed characters exceeded

    • I just ran into this problem as well. I added an append structure to REGUH, you can not check the initial value column.

      @Jerry: That's not true. You can always check the box for a DB field. When you use an append structure in a DB table, by default the Initialization flag is not shown. You simply need to go to Extras->DB Attributes -> Init flag On/Off. This removes the need to use a program to fix the issue for new records.

  • Posted on May 05, 2011 at 04:01 PM

    Hi Olivier,

    Similarly you could use the following to update all NULL values to spaces using SQL etc...

    update ZTABLE set ZFIELD = ' ' where ZFIELD is null

    Best regards,

    -Derrick

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 20, 2011 at 08:33 AM

    Hi,

    Do one thing. Change the table and now check the Initialize flag and the go to database Utility and check the radio button Save and Adjust and then activate the table. You will not lose the data.

    Thnx,

    Bhargav.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2011 at 12:59 PM

    Hi Olivier,

    Please change the INIT Flag within the Extras TAB and then goto SE14 to adjust the database table.

    Though updating the Table with changes in the value NULL is easy to do it, sometimes the ztable cannot be adjusted automatically which leads to data inconsistency.

    Revert for further clarification

    Thanks

    Sri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2011 at 10:35 AM

    HI,

    Go to SE14 give the table name , Select Extras->Force conversion that initiates all the null Values...

    Regards,

    Deepak.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Deepak,

      I have added an append structure to table MARC with several CHAR1 fields for checkboxes.

      Our development system is running on OS: Linux/DB: Oracle and has no problems in SE16 filtering on these new fields.

      After transporting the append structure to a customer system running on OS: Microsoft Server 2008/DB: MS SQL Server, transaction SE16 was behaving unexpected as selection on the new fields were returning not all expected records.

      MS SQL Server handles NULL values differently than Oracle.

      You gave me the solution for our problem:

      transaction SE14 > table MARC > Select Extras >Force conversion that initiates all the null Values

      This action has to be repeated in every system at the customer (development, test and production).

      Thank you very much for sharing your solution.

      NOTE: it is impossible to set the Initial value flag in a table for fields added via an append structure.

      Edited by: R. J. Bouwknegt on Jul 18, 2011 12:17 PM

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.