在SE11表中检查初始值initial value,ABAP中的初始值和空值
2014-09-26 11:15
106 查看
1、在开发中遇到这样的情况:一个表使用了一段时间之后需要增加一些字段,而表中已经存在数据了。
2、SE16(N)查看数据时,SAP把具有初始值和空值的字段都显示为初始值,但是在查询语句中,它们在数据库中的行为是不一样的。
3、While designing new table, we often enable the initial value check to set the initial value for the field based on the datatype.
A field can also be created in the database as NOT NULL if the initial flag isnot set in the ABAP Dictionary.
To see the default value of each field check
Utilities -> Database object ->Display in the maintenance screen of the corresponding table.
But in select query there are some impact
NULL means that physically nothing is stored in the database. If a database field is defined as CHAR with, say, 80 characters, the NULL value will not waste that space.
When NULL values are transfered from the database, they are converted to the ABAP initial value. But if existing database tables are extended appending new field(s), those fields get stored as NULL values for the existing database records. A WHERE <field>
= SPACE will not retrieve the recors with NULL values for the field.
If such a null field is used in WHERE clause, no problem if specifying any values except initial.
If selection of records with initial fields is required and you do not know if NULL values exist, select
WHERE ( <field> = space or <field> is NULL ).
So we have to check this aspect of table while doing programming.
4、There is an option to convert all the null values to their respective initial values in transaction SE14. The 'Force Conversion' option available in Menu option 'Extras' will adjust the table replacing NULL will the initial values. Just thought of sharing
it here。
2、SE16(N)查看数据时,SAP把具有初始值和空值的字段都显示为初始值,但是在查询语句中,它们在数据库中的行为是不一样的。
3、While designing new table, we often enable the initial value check to set the initial value for the field based on the datatype.
A field can also be created in the database as NOT NULL if the initial flag isnot set in the ABAP Dictionary.
To see the default value of each field check
Utilities -> Database object ->Display in the maintenance screen of the corresponding table.
But in select query there are some impact
NULL means that physically nothing is stored in the database. If a database field is defined as CHAR with, say, 80 characters, the NULL value will not waste that space.
When NULL values are transfered from the database, they are converted to the ABAP initial value. But if existing database tables are extended appending new field(s), those fields get stored as NULL values for the existing database records. A WHERE <field>
= SPACE will not retrieve the recors with NULL values for the field.
If such a null field is used in WHERE clause, no problem if specifying any values except initial.
If selection of records with initial fields is required and you do not know if NULL values exist, select
WHERE ( <field> = space or <field> is NULL ).
So we have to check this aspect of table while doing programming.
4、There is an option to convert all the null values to their respective initial values in transaction SE14. The 'Force Conversion' option available in Menu option 'Extras' will adjust the table replacing NULL will the initial values. Just thought of sharing
it here。
相关文章推荐
- 检查某字段是否为空值
- SE11 Conversion Routine
- ABAP 语法检查错误消息汉化版
- seandroid linux 4.2 的 setool 检查权限通不过的解决。
- 冒泡法解决Jquery 下radio和checkbox的提交空值检查问题
- The ABAP Runtime Trace (SE30) - Quick and Easy
- Oracle EBS-SQL (WIP-11):检查期间任务完工记录数.sql
- 11 03 24 检查
- Oracle EBS-SQL (INV-11):检查子库存会计信息.sql
- ABAP中如何检查字母数字类型(alpha numeric)的变量
- ABAP 扩展的语法检查
- JAVA_SE基础——11.Java中的运算符
- 检查SAP各个Client的初始口令
- 使用SLIN事务码进行ABAP程序扩展语法检查
- ABAP权限检查,TCode与权限对象进行关联
- Java SE/EE剖析工具JProfiler 7发布了:探针、线程和堆检查
- SAP-ABAP用户权限检查
- abap中利用se95还原程序到原始版本
- 你好,C++(11)如何用string数据类型表示一串文字?根据初始值自动推断数据类型的auto关键字(C++ 11)
- 转Android 安全攻防(三): SEAndroid Zygote执行用户态许可检查控制