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: 

Dictionary Table

Former Member
0 Kudos

Hi to all!

Is it possible to create a field table to define a 'null' value? different from 'blank' value?

Thanks,

Gianluca

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos

Hi ...

Place the value for the null representation in single quotation marks. This is a plain text value that the SAP DB Loader represents as a character string or binary numeric value. This depends on the external data type of the column for which you want to generate the representation of the null value.

If you want to display the null value representation in one of the external data types for binary values, it must have a valid numeral format. This means either a floating decimal number in mantissa/exponent representation or a fixed point number with the currently agreed or standard decimal setting.

The generated null value representation is written to the same place in the data stream as the actual column value.

· If the null value representation is shorter than the length of the value specified by the position, the value is filled with space characters. If the null value representation is longer, it is shortened to the specified length. The SAP DB Loader generates a warning.

· If columns in the target table permit NULL values and you have not specified a null value representation, the SAP DB Loader default is used for unloaded NULL values (null_spec). This has the external data type CHAR.

· If you define a null value representation for unloading NOT-NULL columns, it does not cause an error.

*----

-


Mandatory columns: NOT NULL columns for which a DEFAULT specification has not been declared as a column attribute are called mandatory columns. Whenever rows are inserted, values must be specified for these columns.

Optional columns: columns that are not mandatory are referred to as optional columns. A value does not have to be specified when a row is inserted in these columns. If a DEFAULT specification exists for the column, the default value is entered in the column. If there is no DEFAULT specification, a NULL value is entered in the column.

If an index is generated for an individual optional column, it does not contain the rows in which the NULL value is specified for this column. With certain queries, therefore, the most effective search strategy cannot be selected via this index. NOT NULL, therefore, should be specified for all columns where the NULL value will not occur. For columns where the NULL value could occur, the definition of a DEFAULT specification should be considered, because its value is used instead of the NULL value. Rows with the DEFAULT value are contained in an index.

*----

-


Thanks

Message was edited by: Saquib Khan

3 REPLIES 3

former_member181966
Active Contributor
0 Kudos

Hi ...

Place the value for the null representation in single quotation marks. This is a plain text value that the SAP DB Loader represents as a character string or binary numeric value. This depends on the external data type of the column for which you want to generate the representation of the null value.

If you want to display the null value representation in one of the external data types for binary values, it must have a valid numeral format. This means either a floating decimal number in mantissa/exponent representation or a fixed point number with the currently agreed or standard decimal setting.

The generated null value representation is written to the same place in the data stream as the actual column value.

· If the null value representation is shorter than the length of the value specified by the position, the value is filled with space characters. If the null value representation is longer, it is shortened to the specified length. The SAP DB Loader generates a warning.

· If columns in the target table permit NULL values and you have not specified a null value representation, the SAP DB Loader default is used for unloaded NULL values (null_spec). This has the external data type CHAR.

· If you define a null value representation for unloading NOT-NULL columns, it does not cause an error.

*----

-


Mandatory columns: NOT NULL columns for which a DEFAULT specification has not been declared as a column attribute are called mandatory columns. Whenever rows are inserted, values must be specified for these columns.

Optional columns: columns that are not mandatory are referred to as optional columns. A value does not have to be specified when a row is inserted in these columns. If a DEFAULT specification exists for the column, the default value is entered in the column. If there is no DEFAULT specification, a NULL value is entered in the column.

If an index is generated for an individual optional column, it does not contain the rows in which the NULL value is specified for this column. With certain queries, therefore, the most effective search strategy cannot be selected via this index. NOT NULL, therefore, should be specified for all columns where the NULL value will not occur. For columns where the NULL value could occur, the definition of a DEFAULT specification should be considered, because its value is used instead of the NULL value. Rows with the DEFAULT value are contained in an index.

*----

-


Thanks

Message was edited by: Saquib Khan

0 Kudos

Saquib,

the data type for my field table is char and numc. I want to define blank value different from null values to import with db-link a record table from sap to external system.

Is it possible?

Thanks,

Gianluca

0 Kudos

I never tried ths out , but when I create a DB , There`s a check box Indicator as "inital values" if you press F1 on that . its say something like

Indicator that NOT NULL is forced for this field

Use

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:

<b>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.</b>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

Thats all I know ...

Thanks