搜索帮助联动
2017-08-22 本文已影响18人
Mmm_余安
一般做搜索帮助我们需要回车才能带出和搜索帮助相关的值,例:
点击物料的搜索帮助回车带出物料描述,现在帮你省掉敲回车的动作,物料和描述同步粗来啦!
首先在PAI里写:
PROCESS ON VALUE-REQUEST.
FIELD ZPRPEOPL MODULE USER_NAME_F4-1."问题提出人
MODULE USER_NAME_F4-1 INPUT.
data: return_tab like ddshretval occurs 1 with header line,
field_tab like dfies occurs 1 with header line,
dynpfields like dynpread occurs 3 with header line.
*取开发人员(名字)
SELECT
USERID "用户名字ID
USERNAME "用户名ID描述(名字)
INTO CORRESPONDING FIELDS OF TABLE GT_UNAME
FROM ZVXXDEV_UNAME
.
SORT GT_UNAME BY USERID USERNAME.
DELETE ADJACENT DUPLICATES FROM GT_UNAME.
*&----调用展示函数
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'USERID' "表格要显示的字段
* PVALKEY = ' '
DYNPPROG = SY-REPID "返回才程序
DYNPNR = SY-DYNNR "屏幕
DYNPROFIELD = 'ZPRPEOPL' "往页面回填值的地方
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
CALLBACK_PROGRAM = SY-REPID "当前程序
CALLBACK_FORM = 'BO_CALLBACK_FORM' "回调函数
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = GT_UNAME
FIELD_TAB = FIELD_TAB
RETURN_TAB = RETURN_TAB
** DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDMODULE.
form bo_callback_form tables record_tab structure seahlpres
changing shlp type shlp_descr_t
callcontrol like ddshf4ctrl.
data: interface like line of shlp-interface,
fp like line of shlp-fieldprop.
read table shlp-interface into interface index 1.
interface-shlpfield+4(1) = '2'.
interface-valfield = 'ZPRPEOPL2'.
append interface to shlp-interface.
endform.
```