1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. SELECT-OPTIONS s_dnattr FOR loyd_msh_msdyn-name. SELECTION-SCREEN END OF BLOCK b1. AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_dnattr-low. PERFORM sh_attr. AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_dnattr-high. PERFORM sh_attr. FORM sh_attr. SELECT name INTO TABLE @DATA(t_dnatr) FROM loyd_msh_msdyn. SORT t_dnatr BY name. DELETE ADJACENT DUPLICATES FROM t_dnatr COMPARING name. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING retfield = 'NAME' dynprofield = 'S_DNATTR' dynpprog = sy-cprog dynpnr = sy-dynnr value_org = 'S' TABLES value_tab = t_dnatr. ENDFORM. |
Еще два способа привязать средство поиска.
- Указываем в качестве типа поля имя поля таблицы в формате ‘TABLE-FIELD’ или ‘STRUCT-FIELD’. В таблице TABLE или структуре STRUCT для поля FIELD должно быть прописано средство поиска или проверочная таблица.
-
PARAMETERS CONTRID type ZSM_STRUCT_SEARCH-CONTRID.
-
- Напрямую указать средство поиска с помощью конструкции MATCHCODE OBJECT, после которой прописываем средство поиска.
-
PARAMETERS CONTRID type ZSM_CONTRACTS-CONTRNAME MATCHCODE OBJECT ZSM_SEARCH_CONTRACTS2.
К полю CONTRID прикрепится средство поиска ZSM_SEARCH_CONTRACTS.
-
Средство поиска с заполнением интерфейса через callback процедуру
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
*&---------------------------------------------------------------------* *& Report ZTEST_ALL *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ztest_all. DATA: BEGIN OF tab OCCURS 0, field1 TYPE char10, field2 TYPE char10, field3 TYPE char10, END OF tab, wa LIKE LINE OF tab, dynpfld_mapping TYPE STANDARD TABLE OF dselc, dyn_wa TYPE dselc, lt_return TYPE TABLE OF ddshretval, lwa_return TYPE ddshretval. INITIALIZATION. wa-field1 = 'aaaaa'. wa-field2 = 'bbbbb'. wa-field3 = 'ccccc'. APPEND wa TO tab. wa-field1 = 'aaaaa'. wa-field2 = 'bbccc'. wa-field3 = 'ddddd'. APPEND wa TO tab. wa-field1 = 'aaaab'. wa-field2 = 'bbccc'. wa-field3 = 'eeeee'. APPEND wa TO tab. dyn_wa-fldname = 'FIELD1'. dyn_wa-dyfldname = 'A'. APPEND dyn_wa TO dynpfld_mapping. dyn_wa-fldname = 'FIELD2'. dyn_wa-dyfldname = 'B'. APPEND dyn_wa TO dynpfld_mapping. dyn_wa-fldname = 'FIELD3'. dyn_wa-dyfldname = 'C'. APPEND dyn_wa TO dynpfld_mapping. * CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING retfield = 'FIELD1' dynpprog = sy-cprog dynpnr = '1000' dynprofield = 'A' value_org = 'S' callback_program = sy-cprog callback_form = 'CALLBACK_F4' * MARK_TAB = MARK_TAB * IMPORTING * USER_RESET = USER_RESET TABLES value_tab = tab return_tab = lt_return. BREAK-POINT. FORM callback_f4 TABLES record_tab STRUCTURE seahlpres CHANGING shlp TYPE shlp_descr callcontrol LIKE ddshf4ctrl. DATA: ls_intf LIKE LINE OF shlp-interface, ls_prop LIKE LINE OF shlp-fieldprop. *Hide unwanted fields CLEAR: ls_prop-shlpselpos, ls_prop-shlplispos. * " Overwrite selectable fields on search help REFRESH: shlp-interface. ls_intf-shlpfield = 'F0001'. ls_intf-valfield = 'A'. ls_intf-f4field = 'X'. APPEND ls_intf TO shlp-interface. ls_intf-shlpfield = 'F0002'. ls_intf-valfield = 'B'. ls_intf-f4field = 'X'. APPEND ls_intf TO shlp-interface. ls_intf-shlpfield = 'F0003'. ls_intf-valfield = 'C'. ls_intf-f4field = 'X'. APPEND ls_intf TO shlp-interface. ENDFORM. |