凡尘clsoho™的博客

E-mail & MSN: clsoho@hotmail.com
QQ1超级群: <101817641已满> QQ2群:<110722895已满>
QQ3超级群:<23765855>QQ4超级群:<85338969>

 

 

CONTROLS

Syntax Forms


Declaration of Table Controls    
表控件的声明 

1.
CONTROLS contrl TYPE TABLEVIEW USING SCREEN screen no.

Declaration of Tabstrip Controls
 选项卡控件的声明

2.
CONTROLS contrl TYPE TABSTRIP.

Effect

With the CONTROLS statement, for each screen used in the program, all table controls and tabstrip controls that are defined there have to be declared in the declaration section, otherwise an untreatable exception occurs when the corresponding screen is called. For contrl, the name of the control that is defined in the screen has to be specified directly. After TYPE, TABLEVIEW or TABSTRIP must be used to specify whether it is a table control or a tabstrip control.

在对控件的描述中,程序中的每个屏幕上所有的表控件和选项卡控件都必须在程序的声明部分进行定义,否则当在调用相关的屏幕时就会产生一个难以处理的异常。对于在屏幕中定义的contorl控件必须直接指定名字,在TYPE之后,TABLEVIEW或者是TABSTRIP必须用来指定它是表控件还是选项卡控件。

 

For each control, the CONTROLS statement creates a structure with the name of the control in the ABAP program. The structure components enable the respective control to be processed in the ABAP program.

对于每个表控件,控件表会在ABAP程序中创建一个以控件名称命名的结构。这个结构的字段使其对应的各自的控件在ABAP程序中被处理。

Note

For table controls, corresponding loops have to be programmed in the screen flow logic. For tabstrip controls, suitable subscreens have to be called.

注:

对于表控件而言,相关的loops语句必须在屏幕逻辑流中进行编写。对于选项卡控件而言,必须调用匹配的子屏幕。

 

CONTROLS - TYPE TABSTRIP

Syntax 语法

CONTROLS contrl TYPE TABSTRIP.

Effect 作用

If you specify the type TABSTRIP in the CONTROLS statement, a deep structure is created with the name of the control and the type CXTAB_TABSTRIP of the type group CXTAB. From this structure, only the component ACTIVETAB is required in the program.

如果你在CONTROLS定义语句中指定类型TABSTRIP,一个深层结构将会被以控件的名字和类型组CXTABCXTAB_TABSTRIP类型创建。从这个结构中,程序中只有字段ACTIVETAB要求输入。

During the PBO processing, the active tabstrip page is specified by assigning the function code of a tab title to the component ACTIVETAB. The first tabstrip page is active by default. When scrolling in the SAP GUI, the tabstrip control can thus be initialized. For any scrolling in an ABAP program, the tabstrip page selected by the user must be activated by this assignment. You must also ensure that the desired subscreen is included in the screen flow logic using the CALL SUBSCREEN statement.

PBO处理期间,通过为选项标题字段ACTIVTAB分配功能码来指定活动的选项卡。第一个选项卡默认为活动的。当滚动SAP GUI时,选项卡控件可以被这样初始化。对于在ABAP程序中的任何滚动,被用户选中的选项卡必须通过这样的分配被激活。你也必须确定用CALL SUBSCREEN语句需要的子屏幕被包含在屏幕逻辑流中。

During PAI processing, the component ACTIVETAB contains the function code of the active tab title. When scrolling in the SAP GUI, you can thus ascertain which tabstrip page is currently displayed.

PAI处理期间,ACTIVETAB字段包含激活的选项卡头的功能码。当在SAP GUI中滚动时,你可以这样确定当前显示的是哪个选项卡。

Note

The same applies to the inclusion of subscreens of tabstrips using CALL SUBSCREEN as for normal subscreens.

CALL SUBSCREEN 同样适用于选项卡包含的子屏幕就像普通子屏幕那样。

Example 例子

If, on a subscreen, a tabstrip control is defined with three untyped tab titles with the function codes "TAB1", "TAB2", and "TAB3" and a subscreen area SUB, the scrolling can be programmed in ABAP as follows. In a PBO module, prepare_tabstrip, the component activetab of the structure tab_strip created using CONTROLS is assigned the function code of the first tab title. After a tab title has been selected, this component is set to the relevant function code in the PAI module handle_user_command. The number of the desired subscreen screen is assigned to the data object dynnr that is used for including the subscreen in the screen flow logic. The corresponding programming of the screen flow logic can be seen in the example for CALL SUBSCREEN.

如果,在一个子屏幕上,一个选项卡控件被定义成三个不同类型的选项卡标题具有功能码"TAB1", "TAB2", "TAB3"并且一个子屏幕区域SUB,滚动可以在ABAP中编写如下。在一个PBO 模块,prepare_tabstrip,用controls创建的结构tab_strip的字段activetab 被分配第一个选项卡的功能码。在一个选项头被选择之后,这个字段在PAI MOUDLE handle_user_command中被设置成相关的功能码。需要的子屏幕数量被分配给用来在屏幕逻辑流中包含子屏幕的数据对象dynnr。屏幕逻辑流相关的编程可以参见例子CALL SUBSCREEN

 

CONTROLS tab_strip TYPE TABSTRIP.
DATA: ok_code TYPE sy-ucomm,
      dynnr TYPE sy-dynnr.
...
MODULE prepare_tabstrip OUTPUT.
  IF tab_strip-activetab IS INITIAL OR
     dynnr IS INITIAL.
    tab_strip-activetab = 'TAB1'.
    dynnr = '0110'.
  ENDIF.
ENDMODULE.
MODULE handle_user_command INPUT.
  CASE ok_code.
    WHEN 'TAB1'.
      dynnr = '0110'.
    WHEN 'TAB2'.
      dynnr = '0120'.
    WHEN 'TAB3'.
      dynnr = '0130'.
    ...
  ENDCASE.
  IF ok_code(3) = 'TAB'.
    tab_strip-activetab = ok_code.
  ENDIF.
ENDMODULE.

 

TABLEVIEW结构包含以下字段:

   字段名             类型                     用途

fixed_cols   integer                  表格左端不可 移动列数。 固定列后面 的所有列都 可以移动, 并能在表格 中重新排序 。

lines               integer                  表格中的可显 示的行数。 如果使用表 格控制来显 示内表,那么,lines 将给出能在 屏幕上显示 的总行数。(如果内表不包含行, 则屏幕表格将在结尾包 含空行)。系统还使用 lines 来设置滚动 条的显示以示意用户在表格中向下滚动了多远 。

top_line          integer        屏 幕开始显示 的表格行。

current_line        integer                  循环内当前正被处理的行 。该字段是 绝对(非相 对)指标, 其值为top_line + sy_stepl.-1

left_col                integer                  最左边非固定的列。因为用户可以滚 动显示的非 固定部分, 所以该字段 控制着出现 在固定列后 面的列号。 left_col 给出列的绝 对(非相对 )值,不管 用户是否重 新排列了列 的顺序。

line_sel_mode     integer                  允许使用行选 择。取值: 0=不选, 1=只选一 行,2=允 许选多行。

col_sel_mode    integer                  允许使用列选 择。取值: 0=不选, 1=只选一 列,2=允许选多列。

line_selector       char 1                   指示器: 显示行选择 栏,这是一 个能在 abap/4 程序中进行 检查的一般 复选框。用 户单击某复 选框时,系 统就将它设 置为 x。

h_grid                char 1                   指示器: 显示水平网 格线

v_grid                 char 1                   指示器: 显示垂直网 格线

cols (occurs 10)  tab_column            嵌入内表:表 格中每个列 的一个表格 条目。

tab_column                                      结构中的字段说明了屏幕表格中的单个字段及其列:

字段名      类型                                                               用途

screen            screen                    嵌入screen结构:所有的字段出自screen系统表格的单个行。

index             integer                   显 示中列的当前位置(用 于用户重新 排列了列顺 序的情况) 。

selected              char 1                     用户单击 该列时,( 系统)将它 设为 x。

vislength           int1                 字段的可见长 度(字符数 )。最大的允许长度为 255 个字符。

                                                        “ 屏幕”类型指的是 screen 表格,系统表格说明了屏幕中的所有字段。

 

 

posted on 2010-01-21 13:20  凡尘clsoho  阅读(3512)  评论(0编辑  收藏  举报