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 92 93 94 95 96 97 98 99 100 101 102 103 104 |
FUNCTION ZSM_SEARCH_CONTRS. *"---------------------------------------------------------------------- *"*"Локальный интерфейс: *" TABLES *" SHLP_TAB TYPE SHLP_DESCR_TAB_T *" RECORD_TAB STRUCTURE SEAHLPRES *" CHANGING *" REFERENCE(SHLP) TYPE SHLP_DESCR_T *" REFERENCE(CALLCONTROL) TYPE DDSHF4CTRL *"---------------------------------------------------------------------- DATA: t_contrs type ZSM_CONTRACTS OCCURS 0, s_contrs type ZSM_CONTRACTS. types: begin of ts_search, mandt type mandt, contrid type ZSM_CONTRID, contrname type ZSM_CONTR_NAME, status type HRBAS_CDOC_ACTIVE, end of ts_search. data: t_search type ts_search occurs 0, s_search type ts_search, s_record_tab type SEAHLPRES. IF callcontrol-step = 'DISP'. "получаем значения CONTRNAME CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET' EXPORTING PARAMETER = 'CONTRNAME' " Reference to search help parameter FIELDNAME = 'CONTRNAME' " Reference to field of Seatinfo TABLES SHLP_TAB = shlp_tab RECORD_TAB = record_tab RESULTS_TAB = t_search CHANGING SHLP = shlp CALLCONTROL = callcontrol EXCEPTIONS PARAMETER_UNKNOWN = 1. "получаем значения CONTRID CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET' EXPORTING PARAMETER = 'CONTRID' " Reference to search help parameter FIELDNAME = 'CONTRID' " Reference to field of Seatinfo TABLES SHLP_TAB = shlp_tab RECORD_TAB = record_tab RESULTS_TAB = t_search CHANGING SHLP = shlp CALLCONTROL = callcontrol EXCEPTIONS PARAMETER_UNKNOWN = 1. "получаем значения STATUS CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET' EXPORTING PARAMETER = 'STATUS' " Reference to search help parameter FIELDNAME = 'STATUS' " Reference to field of Seatinfo TABLES SHLP_TAB = shlp_tab RECORD_TAB = record_tab RESULTS_TAB = t_search CHANGING SHLP = shlp CALLCONTROL = callcontrol EXCEPTIONS PARAMETER_UNKNOWN = 1. CLEAR record_tab[]. DATA t_search2 like t_search. LOOP AT t_search into s_search. IF s_search-status = 'X'. s_record_tab = s_search. APPEND s_search TO t_search2. "APPEND s_record_tab to record_tab. ENDIF. ENDLOOP. call function 'F4UT_RESULTS_MAP' tables shlp_tab = shlp_tab record_tab = record_tab source_tab = t_search2 changing shlp = shlp callcontrol = callcontrol exceptions illegal_structure = 1 others = 2. ENDIF. ENDFUNCTION. |
В приведенном выше пользовательском средстве поиска выполняется фильтрация данных. На шаге «DISP» с помощью ФМ ‘F4UT_PARAMETER_VALUE_GET’ получаем данные возвращаемые средством поиска и осуществляем пользовательскую фильтрацию данных.