SAP基本搜索帮助及增强出口 |
您所在的位置:网站首页 › 字段检索的定义 › SAP基本搜索帮助及增强出口 |
se11创建基本搜索帮助时,各个参数的含意 ![]() ![]() 表或者结构绑定搜索帮助及字段分配与联动搜索帮助 建立如下搜索帮助![]() ![]() 以上完成了搜索帮助的绑定及字段分配, 定义以下选择屏幕,或者在自定义屏幕中参照结构创建输入字段. PARAMETERS p_werks TYPE zstest-werks . PARAMETERS p_lgort TYPE zstest-lgort. PARAMETERS p_lgobe TYPE zstest-lgobe .提前输入工厂字段的值,对库存地点使用搜索帮助时,工厂字段会自动带入的输入参数werks中,选择命中列表的条目后,会同时填写库存地点及库存地点描述字段. ![]() ![]() ![]() 以上就实现了输入参数的联动及选择结果填充多个字段.联动搜索帮助 搜索帮助出口的用法 搜索帮助出口可以使得搜索帮助更加的灵活 搜索帮助出口函数要求和系统函数F4IF_SHLP_EXIT_EXAMPLE具有相同的参数. 复制函数F4IF_SHLP_EXIT_EXAMPLE到自定义的函数,参照F4IF_SHLP_EXIT_EXAMPLE的代码根据需求完成自定义函数的代码 搜索帮助出口函数各个参数的含义![]() 搜索帮助增强出口使用方法 *"*"本地接口: *" TABLES *" SHLP_TAB TYPE SHLP_DESCT *" RECORD_TAB STRUCTURE SEAHLPRES *" CHANGING *" VALUE(SHLP) TYPE SHLP_DESCR *" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL *"---------------------------------------------------------------------- * EXIT immediately, if you do not want to handle this step IF callcontrol-step 'SELONE' AND callcontrol-step 'SELECT' AND " AND SO ON callcontrol-step 'DISP'. EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP SELONE (Select one of the elementary searchhelps) *"---------------------------------------------------------------------- * This step is only called for collective searchhelps. It may be used * to reduce the amount of elementary searchhelps given in SHLP_TAB. * The compound searchhelp is given in SHLP. * If you do not change CALLCONTROL-STEP, the next step is the * dialog, to select one of the elementary searchhelps. * If you want to skip this dialog, you have to return the selected * elementary searchhelp in SHLP and to change CALLCONTROL-STEP to * either to 'PRESEL' or to 'SELECT'. IF callcontrol-step = 'SELONE'. * PERFORM SELONE ......... EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP PRESEL (Enter selection conditions) *"---------------------------------------------------------------------- * This step allows you, to influence the selection conditions either * before they are displayed or in order to skip the dialog completely. * If you want to skip the dialog, you should change CALLCONTROL-STEP * to 'SELECT'. * Normaly only SHLP-SELOPT should be changed in this step. IF callcontrol-step = 'PRESEL'. * PERFORM PRESEL .......... EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP SELECT (Select values) *"---------------------------------------------------------------------- * This step may be used to overtake the data selection completely. * To skip the standard seletion, you should return 'DISP' as following * step in CALLCONTROL-STEP. * Normally RECORD_TAB should be filled after this step. * Standard function module F4UT_RESULTS_MAP may be very helpfull in this * step. IF callcontrol-step = 'SELECT'. IF sy-uname = 'PLM-SEAN'. BREAK-POINT. ENDIF. "RECORD_TAB表的string字段里边包含了三位的空位及按照搜索帮助输出字段位置lpos顺序排列的各个输出字段的合并 SELECT FROM t001l FIELDS concat( concat( concat( mandt ,werks ), lgort ),lgobe ) AS string INTO TABLE @record_tab. SELECT * FROM t001l INTO TABLE @DATA(lt_t001l). "也可以使用系统标准函数F4UT_RESULTS_MAP将源数据绑定到recordtab CALL FUNCTION 'F4UT_RESULTS_MAP' * EXPORTING * SOURCE_STRUCTURE = * APPLY_RESTRICTIONS = ' ' TABLES shlp_tab = shlp_tab record_tab = record_tab source_tab = lt_t001l CHANGING shlp = shlp callcontrol = callcontrol * EXCEPTIONS * ILLEGAL_STRUCTURE = 1 * OTHERS = 2 . IF sy-subrc 0. * Implement suitable error handling here ENDIF. callcontrol-step = 'DISP'. * IF RC = 0. * CALLCONTROL-STEP = 'DISP'. * ELSE. * CALLCONTROL-STEP = 'EXIT'. * ENDIF. EXIT. "Don't process STEP DISP additionally in this call. ENDIF. *"---------------------------------------------------------------------- * STEP DISP (Display values) *"---------------------------------------------------------------------- * This step is called, before the selected data is displayed. * You can e.g. modify or reduce the data in RECORD_TAB * according to the users authority. * If you want to get the standard display dialog afterwards, you * should not change CALLCONTROL-STEP. * If you want to overtake the dialog on you own, you must return * the following values in CALLCONTROL-STEP: * - "RETURN" if one line was selected. The selected line must be * the only record left in RECORD_TAB. The corresponding fields of * this line are entered into the screen. * - "EXIT" if the values request should be aborted * - "PRESEL" if you want to return to the selection dialog * Standard function modules F4UT_PARAMETER_VALUE_GET and * F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step. IF callcontrol-step = 'DISP'. * PERFORM AUTHORITY_CHECK TABLES RECORD_TAB SHLP_TAB * CHANGING SHLP CALLCONTROL. EXIT. ENDIF.
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |