Application Development 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: 

Difference between 'Not Null' and 'Initial' in data dictionary

former_member226225
Contributor
0 Kudos

Hi all,

    

(1) If the field is defined on the database with NOT NULL as initial value, the field is filled

with the corresponding initial value.

  (2) If the field is defined on the database as NOT NULL without initial value, an insert is not

possible. This results in a database error.

  (3) If the field is not defined on the database as NOT NULL, there will be a NULL value in

this field.

Now i am having one question on this ..

Whenever i am creating a field in the table,the field is defined on the database as NOT NULL.

if i set initial field on then it should fill the initial values that is working fine.

but if i leave initial field as empty,and if i try to insert initial values then i should get an error but that is not happening.

And how can i define a field on the database as NOT NULL and NULL.

Thanks,

Raghunadh.K

1 REPLY 1

Former Member
0 Kudos

Hi Raghunandh,

A Database NULL value represents a field that has never been stored to database - this saving space, potentially.

Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.

But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.

as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.

If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are converted to their initial values anyway.

hope this helps

regards

Dipesh