Maintain view
在function group中跑逻辑的时候内表的存在形式其实是extract的长字符内表,所以很多时候操作起来不太方便,需要在event 中添加逻辑,下面是maintain view的常用逻辑介绍:
01 Before saving the data in the database在数据库中保存数据之前
02 After saving the data in the database在数据库中保存数据之后
03 Before deleting the data displayed在删除显示的数据之前
04 After deleting the data displayed删除显示的数据之后
05 Creating a new entry创建新条目
06 After completely performing the function 'Get original'在完全执行“Get.”函数之后
07 Before correcting the contents of a selected field在校正所选字段的内容之前
08 After correcting the contents of a selected field在校正所选字段的内容之后
09 After getting the original of an entry在获得条目的原件之后
10 After creating the header entries for the change task (E071) 在为更改任务创建头条目之后(E071)
11 After changing a key entry for the change task (E071K) 在更改更改任务的键条目之后(E071K)
12 After changing the key entries for the change task (E071K) 在更改更改任务的键条目之后(E071K)
13 Exit editing (exit main function module) 退出编辑(退出主功能模块)
14 After lock/unlock in the main function module主功能模块锁定/解锁后
15 Before retrieving deleted entries在检索删除的条目之前
16 After retrieving deleted entries检索删除的条目之后
17 Do not use. Before print: Event 26不要使用。打印前:事件26
18 After checking whether the data has changed在检查数据是否已更改之后
19 After initializing global variables, field symbols, etc. 初始化全局变量、字段符号等之后。
20 after input in date subscreen (time-dep. tab./views) 在日期子屏幕(time-dep.tab./views)中输入之后
21 Fill hidden fields填充隐藏字段
22 Go to long text maintenance for other languages进行其他语言的长文本维护
23 Before calling address maintenence screen在调用地址维护屏幕之前
24 After restricting an entry (time-dep. tab./views) 在限制条目之后(time-dep.tab./views)
25 Individual authorization checks 个别授权检查
26 Before creating a list在创建列表之前
27 After creation or copying a GUID (not a key field)创建或复制GUID(不是键字段)之后
28 After entering a date restriction for time-dep. views输入时间段视图的日期限制之后
1、maintain view的screen-group = 'KEY'是非常重要的参数,在后期添加KEY值一定需要添加这个group标记,会减掉很多错误,对Jion 了多个table的view如果发生栏位的新增,必须要对view进行update,否则值不会更新上去。
2、maintenance type 一般选择one step,如果是table中字段太多,则需要选择step 2,不然会报错:memory for screen LOAD is used up,原因是表字段太多,需要建立的memory 不够。
3、给maintain view 加上sort 排序功能
给maintain view加上sort的排序功能: ( )
Environment => modification => User Interface => standard->individual => 修改function group 中GUI Status中 EALX、ESLG、EULG。
Source Code Section:获取光标所在位置,得到需要sort的Field Name,然后根据找到该字段在DD01L中的位置,动态地得到EXTRACT中的位置,
[ SPLIT fname AT '-' INTO fname fname.
SELECT * INTO wa_dd03l FROM dd03l
ASSIGN extract+offset(len) to <fs>.
SORT extract STABLE BY <fs>. ]
若是普通的table control中的排序,SORT extract STABLE BY (fname).
注:sort只可以BY单行
4、怎么对select-option直接转换为标准的SQL能识别的where条件:(日期和事件函数不可用)
CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'EXPORTINGfieldname = 'WERKS'append_conjunction = 'AND'TABLESsellist = dba_sellistrangetab = s_werks.
5、将模式调整为display
APPEND:'NEWL' TO excl_cua_funct,'ALNW' TO excl_cua_funct,'ALOE' TO excl_cua_funct,'KOPE' TO excl_cua_funct,'DELM' TO excl_cua_funct,'AEND' TO excl_cua_funct,'DELE' TO excl_cua_funct.
* status-action = 'S'.VIEW_ACTION = 'S'.