【】UP TO N ROWS在SELECT中的使用,读取前N行,不继续读取数据
【】PACKAGE SIZE N ,一次读取N条,接着读取N条
【】内连接:
SELECT SPFLI~CARRID SFLIGHT~FLDATE
INTO ...
FROM SPFLI INNER JOIN SFLIGHT
ON SPFLI~CARRID = SFLIGHT~CARRID
AND SPFLI~CONNID = SFLIGHT~CONNID UP TO 10 ROWS.
ENDSELECT.
【】NEW-PAGE 输出无条件换页
【】NEW-PAGE LINE-COUNT 20 换页并定义新页面的长度
【】列表颜色的更改:
FORMAT COLOR <n> [ON] [INTENSIFIED][ON|OFF]INVERSE [ON|OFF]
COLOR参数:
COL_BACKGROUND 取决于GUI
COL_HEADINING
COL_NORMAL
COL_TOTAL
COL_KEY
COL_POSITIVE
COL_NEGATIVE
COL_GROUP
INTENSIFIED参数:背景颜色参数
INVERSE参数:是否影响前景颜色
FRAMES [{ON|OFF}|{= flag}] 将| - 连接在一起
例子:
FORMAT COLOR COL_HEADING.
WRITE : 'hello'.
WRITE 'aa'. "hello aa 背景色是蓝色
FORMAT COLOR COL_HEADING INVERSE on.
WRITE 'hello'.
WRITE 'bb'. "hello bb 背景不受影响
DATA: input_field TYPE c LENGTH 100,
line_num TYPE i.
START-OF-SELECTION.
WRITE 'Input text:'.
SET BLANK LINES ON.
FORMAT INPUT.
WRITE / input_field.
FORMAT INPUT OFF.
WRITE / '>>> OK <<<' COLOR 5 HOTSPOT.
AT LINE-SELECTION.
IF sy-lisel = '>>> OK <<<'.
line_num = sy-lilli - 1.
READ LINE line_num FIELD VALUE input_field.
WRITE: 'The input was:',
/ input_field.
ENDIF.
FORMAT FRAMES ON.
PERFORM frame.
FORMAT FRAMES OFF.
FORM frame.
SKIP.
WRITE: / '----',
/ '| |',
/ '----'.
ENDFORM. "输出为一个封闭的长方形
【】制作工具按钮使用ABAP菜单编辑器,T-CODE: SE41
【】按钮设置语句: SET PF-STATUS 'STATUS1'.
【】窗口输出: WINDOW STARTING AT 10 10 ENDING AT 30 20.
WRITE:'窗口输出内容'.
【】列表输出复选框:
DATA SEL(1) TYPE C.
WRITE : / SEL AS CHECKBOX.
【】PARAMETERS {para[(len)]}|{para [LENGTH len]}
[type_options]
[screen_options]
[value_options]
[ldb_options].
SCREEN_OPTIONS:
{ {[OBLIGATORY|NO-DISPLAY] [VISIBLE LENGTH vlen]}
| {AS CHECKBOX [USER-COMMAND fcode]}
| {RADIOBUTTON GROUP group [USER-COMMAND fcode]}
| {AS LISTBOX VISIBLE LENGTH vlen [USER-COMMAND fcode]
[OBLIGATORY]} }
[MODIF ID modid] ... .
OBLIGATORY: 必须输入项
例子:
PARAMETERS p_carrid TYPE spfli-carrid
AS LISTBOX VISIBLE LENGTH 20 "下拉列表
USER-COMMAND onli
DEFAULT 'LH'. "屏幕输出一个有默认值的list
PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p4 TYPE c LENGTH 10 MODIF ID bl2,
p5 TYPE c LENGTH 10 MODIF ID bl2,
p6 TYPE c LENGTH 10 MODIF ID bl2.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
LOOP IF show_all <> 'X' AND
screen-group1 = 'BL2'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP. " AT SCREEN.
选择了show_all,则显示b2 screen
VALUE_OPTIONS:
[DEFAULT val]
[LOWER CASE] "大小写
[MATCHCODE OBJECT search_help]
[MEMORY ID pid]
[VALUE CHECK] ... .
例子:
PARAMETERS p_carrid TYPE s_carr_id
MATCHCODE OBJECT demo_f4_de. "为p_carrid字段加载search help
LDB_OPTIONS:
FOR {TABLE|NODE} node
[HELP-REQUEST]
[VALUE-REQUEST]
[AS SEARCH PATTERN] ... .
【】SELECTION-SCREEN的单选、复选、按钮
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS A1 RADIOBUTTON GROUP RG1,
PARAMETERS A2 RADIOBUTTON GROUP RG1, "单选
PUSHBUTTON 2(10) S1 USER-COMMAND C1,
PUSHBUTTON 12(10) S2 USER-COMMAND C2, "按钮
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM. (TABLES SSCRFIELDS)
WHEN 'C1'.
DONE = 'C1'.
WHEN 'C2'.
DONE = 'C2'.
ENDCASE.
【】在普通屏幕里调用子屏幕
PBO:
CALL SUBSCREEN A1 INCLUDINING SY-REPID '0100'.
PAI:
CALL SUBSCREEN A1.
【】字段检查
FIELD <FID1> MODULE <MOD1>. "单个字段检查
FIELD <FLD2> MODULE <MOD1>,<MOD2>. "单个字段多检查
CHAIN. "检查多字段
FIELD <FLD1>,<FLD2>,<FLD2>.
MODULE <MODL1>.
MODULE <MODL2>.
ENDCHAIN.
FIELD <FLD1> MODULE <MDL1> ON INPUT. "初始值检查
FIELD <FLD1> MODULE <MDL1> ON REQUEST. "变更检查
CHAIN.
FILED <FLD1>.
MODULE <MOD1> ON CHAIN-INPUT.
ENDCHAIN. "初始值检查
【】屏幕LIST
TYPE-POOLS VRM.
DATA: FNAME TYPE VRM_ID,
VVA TYPE VRM_VALUES,
LVVA LIKE LINE OF VVA.
...
MODULE STATUS_0100 OUTPUT.
FNAME = 'FLD1'.
LVVA-KEY = '1'.
LVVA-KEY = '广州'.
APPEND LVVA TO VVA.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = FNAME
VALUE = VVA.
ENDMODULE. "为屏幕输入字段设置LIST并添加LIST内容