SAP-ABAP-搜索帮助,及搜索帮助出⼝1.创建搜索帮助
2.使⽤说明
2.1选择⽅法:指定搜索帮助表数据来源
2.2对话类型
2.2.1根据值集合的对话:如果数据量⼤于100条就不会直接展⽰数据,会先展⽰⼀个筛选界⾯
2.2.2⽴即显⽰值:就是⽴即展⽰数据源表中的全部数据
2.2.3具有值限制的对话:搜索帮助⼀开始不会将数据表中的全部数据展⽰出了,会给个筛选条件
2.3输⼊字段的建议搜索帮助:如果勾选该字段则不需要调⽤搜索帮助,在输⼊字段中直接输⼊与该字段同名的搜索帮助的输⼊参数的值,系统会根据你输⼊的内容在下⽅显⽰筛选结果.如果数据量⼤,或者搜索帮助附加字段太多了不建议使⽤
2.4多列全⽂搜索;容错全⽂本搜索的精确值
excel插入图片不使⽤搜索,⽽使⽤输⼊时,会将输⼊的数据按照字符串搜索表数据,按照搜索的精确值来显⽰最终数据。不建议使⽤,⽐较影响运⾏速度
2.5搜索帮助出⼝:可在创建的function中写⼊代码控制搜索帮助的数据。后⾯详细说明
2.6搜索帮助参数:展⽰出来的数据有哪些字段
2.7 IMP : 导⼊参量,⽤这些参量,从输⼊模板或处理屏幕的模板池中得到的值能复制给输⼊帮助处理。
2.8 EXP: 导出参量,⽤这些参量,从输⼊帮助处理得到的值能返回给输⼊模板。
2.9列表:该参数字段在命中列表的位置
2.10选择:该字段在选择屏幕中位置
2.11 选择:该参数的内容将告知⽤户该限制,但是⽆法更改该限制,这是可取的例如当该参数是导⼊参数或它有⼀个默认值。
2.12数据元素:参数字段对应的数据元素,必输
2.13已修改:如果⼀开始的搜索帮助变更了,此处勾会勾上,与使⽤⽤户⽆关
2.14缺省值:控制数据的默认值,默认值只能输⼊三种类型,a系统参数,如SY-DATUM;b内存get参数,如公司代码的内存参数BUK;c真正的默认值,需要⽤单引号包起来。
3.搜索帮助出⼝,SE37复制function--F4IF_SHLP_EXIT_EXAMPLE。注意命名和函数组,函数组要⽤Z开头的函数组,复制出来的名字建议按照ZFI_SH_CAR_TYPE_F4_EXIT类似命名,否则可能不让修改
异地医保怎么办理
复制完成的搜索帮助不会控制任何东西,在选择⼀次搜索帮助时会调⽤四次出⼝,⽤参数CALLCONTROL-STEP来控制是第⼏次
第⼀次:CALLCONTROL-STEP = 'SELONE'.
第⼀次的调⽤仅⽤于复合搜索帮助,在这次调⽤中它可以被使⽤以减少在SHLP_TAB中给出的基本搜索帮助的数量。
第⼆次:CALLCONTROL-STEP = 'PRESEL'.
第⼆次的调⽤我们可以修改⼀下限制条件,或者为了完全跳过对话框。
第三次:CALLCONTROL-STEP = 'SELECT'.
如何隐藏桌面图标这⼀步可以⽤来完全取代数据选择。
第四次:CALLCONTROL-STEP = 'DISP'.
第四次调⽤之后前台将展⽰表RECORD_TAB的数据,我们可以在这次调⽤中增减这个表的数据来影响最终展⽰数据
电脑开机自检
附上某个例⼦的代码
FUNCTION zfi_sh_car_type_f4_exit.
*"----------------------------------------------------------------------
*"*"本地接⼝:
*" 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 archhelps)
*"----------------------------------------------------------------------
* This step is only called for collective archhelps. It may be ud
* to reduce the amount of elementary archhelps given in SHLP_TAB.
* The compound archhelp is given in SHLP.
* If you do not change CALLCONTROL-STEP, the next step is the
* dialog, to lect one of the elementary archhelps.
* If you want to skip this dialog, you have to return the lected
* elementary archhelp 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 lection conditions)
*"----------------------------------------------------------------------
* This step allows you, to influence the lection 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 ud to overtake the data lection completely.
* To skip the standard letion, 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'.
EXIT. "Don't process STEP DISP additionally in this call.
ENDIF.
*"----------------------------------------------------------------------
* STEP DISP (Display values)
*"----------------------------------------------------------------------
* This step is called, before the lected data is displayed.
* You modify or reduce the data in RECORD_TAB
* according to the urs 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 lected. The lected 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 lection 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.
DATA ls_tab TYPE ahlpres .
CLEAR : record_tab,record_tab[].
SELECT S~SIGN ,S~OPTION,S~LOW,S~HIGH FROM @SHLP-SELOPT AS S INTO TABLE @DATA(S_CAR) .
SELECT ries_and_development_cod FROM zcar_type INTO TABLE @DATA(lt_car) WHERE ries_and_development_cod IN @S_CAR. SORT lt_car BY ries_and_development_cod .
DELETE ADJACENT DUPLICATES FROM lt_car COMPARING ALL FIELDS .
LOOP AT lt_car INTO DATA(ls_car).
ls_tab-string+192(50) = ls_car-ries_and_development_cod . ""字段SERIES_AND_DEVELOPMENT_COD在表ZCAR_TYPE中是第193的位置,所以新增⾏只能 ls_tab-string+242(22) = ls_car-ries_and_development_cod .
ls_tab-string(50) = ls_car-ries_and_development_cod .
ls_tab-string+50(22) = ls_car-ries_and_development_cod .
INSERT INITIAL LINE INTO record_tab INDEX 1 ASSIGNING FIELD-SYMBOL(<fs_tab>).
<fs_tab> = ls_tab .
ENDLOOP.
" RECORD_TAB[ 1 ] = LS_TAB .
" SELECT SINGLE SERIES_AND_DEVELOPMENT_COD FROM ZCAR_TYPE INTO @DATA(LV_CAR) .
ls_tab-string+192(50) = '通⽤车型' .
ls_tab-string+242(22) = '通⽤车型' .
ls_tab-string(50) = '通⽤车型' .
ls_tab-string+50(22) = '通⽤车型' .
INSERT INITIAL LINE INTO record_tab INDEX 1 ASSIGNING <fs_tab>.
<fs_tab> = ls_tab .
EXIT.
ENDIF.
女孩好听的名字ENDFUNCTION.