现在的位置: 首页 > 综合 > 正文

ABAP程序系统字段中英文详解_华亭慧剑译

2013年10月07日 ⁄ 综合 ⁄ 共 4967字 ⁄ 字号 评论关闭

原帖地址: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
access individual letters directly by specifying the offset/length,
regardless of the

code page

.

sy-batch

c(1)

在一个后台运行的ABAP
程序中设置为“X
”,否则就是初始值。

Set to "X" in an
ABAP program that runs in the background, otherwise initial.

sy-binpt

c(1)

在批处理输入会话中设置为“X
”,在ABAP
程序中调用usingCALL
TRANSACTION USING


。否则就是初始值。

Set to "X" during
processing ofbatch input sessions

, and in
ABAP programs called using

CALL TRANSACTION USING

. Otherwise
initial.

sy-calld

c(1)

在一个调用序列中的第一
个程序里为空字符串,否则为值“X
”。在调用usingCALL TRANSACTION

CALL
DIALOG


或者SUBMIT ... AND RETURN


变为“X
”。如果程序以LEAVE
TO TRANSACTION


或者从一个屏幕事务开始的话,则为空。使用SUBMIT

(没有AND
RETURN


)时设定为调用它的程序的值。

Contains a blank
character in the first program in acall sequence

, otherwise contains the value
"X". Is set to "X" after calls using

CALL TRANSACTION


,
CALL
DIALOG


, or
SUBMIT ... AND RETURN

. Empty if the
program was started using

LEAVE TO TRANSACTION

or a transaction
from thescreen

. A call using

SUBMIT

(without
AND
RETURN


) assumes the value of the calling program.

sy-callr

c(8)

当打印清单时,显示打印从何处开始的值,例如NEW-PAGE


程序控制的打印,或者RSDBRUNT
为从一个选择屏幕打印。

When printing lists, contains a value
that displays where the printing was started, for example,

NEW-PAGE

for
program-controlled printing, or RSDBRUNT for printing from theselection screen

.

sy-colno

i

在清单缓冲区中创建清单过程中的当前位置。从1
开始计算。在
Unicode
系统中,这个位置也符合显示清单中的列。在Unicode

统中,由于清单缓冲区中的一个字符可能占多列,这只保证每个输出的最低和最高的输出能力。

Current position
during creation of a list in the list buffer. Counting begins at 1. In
non-Unicode systems

, this
position also corresponds to the column in the displayed list. In
Unicode systems, this is only guaranteed for the lower and upper output
limits applicable to each output, as one character may take up more
columns in the list than positions in the list buffer.

sy-cpage

i

当清单事件被触发时,显示在清单顶端的页码。从1
开始。

Page number of the page displayed at the
top of the list for which a list event was triggered. Counting begins at
1.

sy-cprog

c(40)

在外部程序调用中,调用程序的名字,否则就是当前程序的名字。如果一个程序包含多级程序调用,sy-cprog

包含框架程序的名字,而不是设置为程序调用序列中的框
架程序名字。

Inprocedures

called externally, the name of the
calling program, Otherwise the name of the current program. If a
procedure called externally calls another external procedure,

sy-cprog

contains the
name of theframework program

, and is not
set to the name of the framework program of the subsequent calling
program.

sy-cucol

i

在屏幕上显示的横向指针
的位置。从第2
列开始。

Horizontal cursor
position in the display on ascreen

. Counting begins at
column 2.

sy-curow

i

在屏幕上显示的纵向指针
的位置。从第1
行开始。

Vertical cursor
position on the screen display of a screen. Counting begins at line 1.

sy-datar

c(1)

PAI
中,如果屏幕上至少有一个输入字段的值被用户或其他
数据传输所更改,则为“X
”,否则为初始值。

AtPAI

, contains "X" if at least one input field of a
screen has been changed by a user or by further data transfer, otherwise
initial.

sy-datlo

d

用户的当前日期,例如:19990723
20000422
。可以用GET TIME

来设置。

Local date of the
user, for example 19990723, 20000422. Can be set using

GET
TIME


.

sy-datum

d

SAP



系统的本地日期。可以用GET
TIME

来设置。

Local date of the SAP system. Can
be set using

GET TIME

.

sy-dayst

c(1)

在夏令时中设置为“X
”,否则为初始值。

"X" during summertime, otherwise initial.

sy-dbcnt

i

SQL



语句把sy-dbcnt

的内容设置为处理过的表行数。

SQL statements
set the content of

sy-dbcnt

to the number of processed table
lines.

sy-dbnam

c(20)

在执行程序中,表示连接
的逻辑数据库


In executable programs, the linkedlogical database

.

sy-dbsys

c(10)

使用的数据库系统,例如ORACEL, INFORMIX

Central database system, for example,
ORACLE, INFORMIX.

sy-dyngr

c(4)

当前屏幕的屏幕组。在屏
幕画笔中,几个屏幕可以指定给一个公共屏幕组,例如,可以用来一次修改同一个屏幕组中的全部屏幕。

Screen group of
the current screen. In theScreen Painter

, several screens can be
assigned to a common screen group, which can be used, for example, for
making modifications to all screens in the group at once.

sy-dynnr

c(4)

当前的屏幕号。在选择屏幕处理过程中,这指定了当前被选中的屏幕。在列表处理过程中,说明了子屏幕容器的数量。在子
屏幕屏幕过程中(包括选项卡),说明了屏幕数量。

Number of the
current screen. Duringselection screen processing

,
this is the current selection screen. During list processing, the number
of the subscreen container. During processing of asubscreen screen

(including intabstrips

), this screen number.

sy-fdayw

b

工厂日历的周日,Monday
1

Friday
5

Factory calendar
weekday, Monday = 1, ..., Friday = 5.

sy-fdpos

i

在字符类型数据对象操作时查找定位。

Found location in
operations with character-type data objects.

抱歉!评论已关闭.