Ну допустим, я показал ему текст некоторой программы:
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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
REPORT y_bc001_text_search. TABLES: tadir. SELECT-OPTIONS: s_devc FOR tadir-devclass DEFAULT 'Z*' OPTION CP. SELECT-OPTIONS: s_objec FOR tadir-object. SELECT-OPTIONS: s_objnm FOR tadir-obj_name DEFAULT 'Z*' OPTION CP. PARAMETERS: p_text TYPE string. START-OF-SELECTION. SELECT tadir~pgmid, tadir~object, tadir~obj_name, trdir~subc, tadir~devclass FROM tadir LEFT OUTER JOIN trdir ON tadir~object = 'PROG' AND tadir~obj_name = trdir~name INTO TABLE @DATA(lt_objects) WHERE tadir~devclass IN @s_devc AND tadir~object IN @s_objec AND tadir~obj_name IN @s_objnm AND ( tadir~object = 'PROG' OR tadir~object = 'FUGR' OR tadir~object = 'CLAS' ). LOOP AT lt_objects ASSIGNING FIELD-SYMBOL(<object>). IF <object>-object = 'PROG' AND ( <object>-subc = '1' OR <object>-subc = 'M' ). DATA: lt_tpool TYPE STANDARD TABLE OF textpool WITH DEFAULT KEY. CALL FUNCTION 'RS_TEXTPOOL_READ' EXPORTING objectname = <object>-obj_name action = 'READ' * AUTHORITY_CHECK = ' ' language = sy-langu TABLES tpool = lt_tpool EXCEPTIONS object_not_found = 1 permission_failure = 2 invalid_program_type = 3 error_occured = 4 action_cancelled = 5 OTHERS = 6. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. LOOP AT lt_tpool ASSIGNING FIELD-SYMBOL(<tpool>). IF <tpool>-id = 'I' AND <tpool>-entry CP p_text. WRITE: <object>-obj_name, <tpool>-key, <tpool>-entry. ENDIF. ENDLOOP. ELSEIF <object>-object = 'FUGR'. DATA: lv_fugr TYPE rs38m-programm. lv_fugr = 'SAPL' && <object>-obj_name. CALL FUNCTION 'RS_TEXTPOOL_READ' EXPORTING objectname = lv_fugr action = 'READ' * AUTHORITY_CHECK = ' ' language = sy-langu TABLES tpool = lt_tpool EXCEPTIONS object_not_found = 1 permission_failure = 2 invalid_program_type = 3 error_occured = 4 action_cancelled = 5 OTHERS = 6. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. LOOP AT lt_tpool ASSIGNING <tpool>. IF <tpool>-id = 'I' AND <tpool>-entry CP p_text. WRITE: <object>-obj_name, <tpool>-key, <tpool>-entry. ENDIF. ENDLOOP. ELSEIF <object>-object = 'CLAS'. DATA: lv_clas TYPE rs38m-programm. lv_clas = <object>-obj_name. DATA(lv_eq_count) = 30 - strlen( lv_clas ). DO lv_eq_count TIMES. lv_clas = lv_clas && '='. ENDDO. lv_clas = lv_clas && 'CP'. CALL FUNCTION 'RS_TEXTPOOL_READ' EXPORTING objectname = lv_clas action = 'READ' * AUTHORITY_CHECK = ' ' language = sy-langu TABLES tpool = lt_tpool EXCEPTIONS object_not_found = 1 permission_failure = 2 invalid_program_type = 3 error_occured = 4 action_cancelled = 5 OTHERS = 6. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. LOOP AT lt_tpool ASSIGNING <tpool>. IF <tpool>-id = 'I' AND <tpool>-entry CP p_text. WRITE: <object>-obj_name, <tpool>-key, <tpool>-entry. ENDIF. ENDLOOP. ENDIF. ENDLOOP. END-OF-SELECTION. WRITE: / 'Search completed:', p_text. |
Так вот, сервис может пояснить за код, лучше чем я:
(далее…)