03-29-2013 12:42 PM
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
04-06-2013 11:08 AM
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