关键字:ABAP入门 ABAP数据类型 ABAP语句
ABAP的数据类型与JAVA和C都类似,主要有:
一、完全ABAP标准类型-Complete ABAP standard types
D Type for data, format: YYYYMMDD, length 8 (fixed)
类型D,日期类型,标准格式为:YYYYMMDD,长度为固定8位
T Type for time, format: HHMMSS, length 6(fixed)
类型T,时间类型,标准格式为:HHMMSS,长度为固定6位
I Type for integer(I), length 4(fixed)
类型I,整形数字,长度为固定4位
F Type for floating point number(F), length 8(fixed)
类型F,浮点数,长度为固定8位
STRING Type for dynamic length character string.
String类型,动态长度的字符串。
XSTRING Type for dynamic length byte sequence(HeXadecimal string)
16位字符串
二、非完全ABAP标准类型
C Type for character string(Charactor) for which the fixed length is to be specified.
类型C,字符字串类型,长度需要提前定义。固定位数的字符组成的字符串。
N Type for numberical string(Numberical charactor) for which the fixed length is to be specified.
类型N,用字符串存储的数字,长度需要提前定义。不可以用来计算,可以用来进行多种可设定的显示。
X Type for byte sequence(HeXadecimal string) for which the fixed length is to be specified.
十六进制变量
P Type for packed number(Packed number) for which the fixed length is to be specified. ( In the definition of a packed number, the number of decimal points may also be specified )
P小数,打包后的小数。ABAP特有小数变量,其整数位数小数位数都可以进行提前的规定。
完全和非完全ABAP标准类型的区别是变量的位数是否固定。非完全ABAP标准类型的变量在定义时需要进行位数的指定,而完全的则不用,按照系统默认规格走。
此外,在ABAP程序中还可以自己定义类型、内表和结构,这些会另开博文进行介绍,本文主要介绍ABAP的基本的普通的数据类型,以供大家对比JAVA和C和ABAP。
elemark
2010年4月1日15:04:39 第二次编辑