Event Blocks:报表事件,
-----------------------------------------------
INITIALIZATION:初始化,所有事件中最早执行的一个事件
----------------------------------------------
选择屏幕创建下拉列表:AS LISTBOX VISIBLE LENGTH XX.
函数'VRM_SET_VALUES'
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_XXX' 选择屏幕定义的名字
VALUES = LT_XXX 需要输出的内容
EXCEPTIONS
id_illegal_name = 1
OTHERS
------------------------------------------------
所有输出内容变小写:
TTRANSLATE LS_XXX TO LOWER CASE.
-----------------------------------------------
AT SELECTION-SCREEN. 检查选择屏幕 ,必须输入值。
IF P_XX IS INITIAL.
MESSAGE 'XXXX' TYPE 'W'
ENDIF
pbo:看到屏幕之前
pai:看到屏幕之后
------------------------------------------------
START-OF-SELECTION. 运行程序
给程序分块儿:
PERFORM XX_XX
FORM
ENDFORM
可以定义FORM里面自己的变量,其他FORM里不可以调用
----------------------------------------------
FIELD-SYMBOLS<XXX> TYPE TY_XXX.
没听懂
LOOP AT XX_XX ASSIGNING <>.
没懂
------------------------------------------------
二分查找 Binary Search
SROT LT_XXX BY XX(字段) 先排序
READ TABLE LT_XXX INTO LS_XXX WITH KEY XX(字段)= 'XXXX'
BINARY SEARCH.
IF SY-SUBRC = 0.
WRITE: / 'the locatin is ',sy-tabix.
ELSE.
WRITE: / 'not found'.
endif.
-----------------------------------------------
AT SELECTION-SCREEN.
检查,把不合理的挡住
PARAMETERS P_XXX TYPE XXX.
SELECTION-SCREEN.
IF NOT ( P_XXX CP 'XXX' OR P_XXX CP 'XXX' ).
message 'xxxxxxx' type ‘ W(E)'.
ENDIF.
----------------------------------------------
在本地读取exl文件到客户端
ZWEEK4_READ_LPCAL_EXCEL