Skip to Content

how to set "Not Null" & "Default" value for a field of a db table in DDIC?

Hi,

Please refer to the picture first: I didn't see the maintenance places for the last 2 properties of a field of dabatase table, "NOT NULL" u201CDEFAULTu201D (). Is that possible with SAP DDIC; if true, how to do it?

http://bbs.sjtu.edu.cn/file/PIC/1214474726179743.JPG

Sorry, i didn't find possibility to upload and display a picture in SDN, can only to upload it here; if you are afraid there is virus, don't click it.

Regards,

Said

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jun 26, 2008 at 11:52 AM

    Hi,

    If the field is specified as Key field in SE11 (DDIC) then the NotNull field is X

    If the fields are specified as VARCHAR, they are defaulted to Zeros.

    reward if useful,

    regards,

    teja.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 26, 2008 at 12:29 PM

    Hi,

    You can check the check box after the fieldname in SE11 i.e. the column name initial.

    If you tick that then this field will not accept null value.

    For default value set the values at the domain level .

    I hope this will help you.

    Help children of U.N World Food Program by rewarding points and encourage others to answer your queries.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sandipan,

      Regarding "Initial Values", it might affect Not Null property; while even it's not checked, Not Null for many fields is still true. You can check it, e.g. the table I attached, INDX, a SAP delivered db table.

      Regarding using domain to set default value, I'll try it.

      Thanks

      Said

  • avatar image
    Former Member
    Jun 27, 2008 at 04:54 AM

    Hi,

    Regarding INITIAL VALUE In SAP DDIC Table

    You can achieve it Enabling(Check) the Checkbox of Initial After key Checkbox.

    If You Do not enter vale for a particular field then field will be filled up with initail value of the Datatype, Field has used.

    you can not set default value for a DDIC Table in SAP.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ping Tong

      Hi,

      pls go throgh following you will understand-

      Selecting INITIAL VALUE FLAG-

      Select this flag if a field to be inserted in the database is to be filled with initial values. The initial value used depends on the data type of the field.

      Please note that fields in the database for which the this flag is not set can also be filled with initial values.

      When you create a table, all fields of the table can be defined as NOT NULL and filled with an initial value. The same applies when converting the table. Only when new fields are added or inserted, are these filled with initial values. An exception is key fields. These are always filled automatically with initial values.

      Restrictions and notes:

      The initial value cannot be set for fields of data types LCHR, LRAW, and RAW. If the field length is greater than 32, the initial flag cannot be set for fields of data type NUMC.

      If a new field is inserted in the table and the initial flag is set, the complete table is scanned on activation and an UPDATE is made to the new field. This can be very time-consuming.

      If the initial flag is set for an included structure, this means that the attributes from the structure are transferred. That is, exactly those fields which are marked as initial in the definition have this attribute in the table as well.

      Regards,

      Sujit