原帖地址:http://space.itpub.net/?uid-11854622-action-viewspace-itemid-490776
系统字段由
ABAP
运行时环境填写,并且可以用来在
ABAP
程序中查询系统状态。除了一个例外(
sy-repid
),系统字段都是变量,但是它们都是只读的。此外,更多程序执
行的重要信息通常都被丢弃。
ABAP
程
序中的系统字段只在极少需要控制系统行为的时候才能被重写。
System fields are filled by the
ABAP runtime environment
and can be used in an ABAP
program to query system statuses. With one exception (
sy-repid
), system
fields are variables, but they should only be accessed on a read-only
basis. Otherwise, important information for further program execution
often gets lost. System fields in ABAP programs can only be overwritten
in a few cases to control system behavior.
对于例外的
sy-repid
,这个系统字段的数据类型在
ABAP
字典的
SYST
结构(
6.10
版以后)中定义,作为
sy
结构(也可以用
SYST
来定位)的组件在
ABAP
程序中有示例。
sy
结构在一个内部会话期间内只存在一次,并且在这个内部会话期间
内被所有程序使用。下表列出了在
ABAP
程
序中可以使用的系统字段。所有
sy
结构的其他组件则或者在
ABAP
运行时环境内部使用或者已经废弃。
With the exception of
sy-repid
, the data
types of the system
fields are defined in the ABAP Dictionary in the structure SYST (as of
release 6.10), and are instantiated in ABAP programs as components of
the predefined structure
sy
, which can
also be addressed using SYST. The structure
sy
exists only
once in an internal session and is used by all programs of an internal
session at the same time. The following table shows the system fields
that can be used in ABAP programs. All other components of the structure
sy
are either
intended for internal use by the ABAP runtime environment or are
obsolete.
名称 Name |
类型 Type |
说明 Content |
sy-abcde |
c(26) |
包含了字母表。可以用来通过指定偏移/ Contains the alphabet. Can be used to |
sy-batch |
c(1) |
在一个后台运行的ABAP Set to "X" in an |
sy-binpt |
c(1) |
在批处理输入会话中设置为“X Set to "X" during |
sy-calld |
c(1) |
在一个调用序列中的第一 Contains a blank |
sy-callr |
c(8) |
当打印清单时,显示打印从何处开始的值,例如NEW-PAGE When printing lists, contains a value |
sy-colno |
i |
在清单缓冲区中创建清单过程中的当前位置。从1 Current position |
sy-cpage |
i |
当清单事件被触发时,显示在清单顶端的页码。从1 Page number of the page displayed at the |
sy-cprog |
c(40) |
在外部程序调用中,调用程序的名字,否则就是当前程序的名字。如果一个程序包含多级程序调用,sy-cprog Inprocedures |
sy-cucol |
i |
在屏幕上显示的横向指针 Horizontal cursor |
sy-curow |
i |
在屏幕上显示的纵向指针 Vertical cursor |
sy-datar |
c(1) |
在PAI AtPAI |
sy-datlo |
d |
用户的当前日期,例如:19990723 Local date of the |
sy-datum |
d |
SAP Local date of the SAP system. Can |
sy-dayst |
c(1) |
在夏令时中设置为“X "X" during summertime, otherwise initial. |
sy-dbcnt |
i |
SQL SQL statements |
sy-dbnam |
c(20) |
在执行程序中,表示连接 In executable programs, the linkedlogical database |
sy-dbsys |
c(10) |
使用的数据库系统,例如ORACEL, INFORMIX Central database system, for example, |
sy-dyngr |
c(4) |
当前屏幕的屏幕组。在屏 Screen group of |
sy-dynnr |
c(4) |
当前的屏幕号。在选择屏幕处理过程中,这指定了当前被选中的屏幕。在列表处理过程中,说明了子屏幕容器的数量。在子 Number of the |
sy-fdayw |
b |
工厂日历的周日,Monday Factory calendar |
sy-fdpos |
i |
在字符类型数据对象操作时查找定位。 Found location in |