Для чтения текстов из ABAP используется функциональный модуль READ_TEXT. Ниже представлен пример чтения текста заголовка FI документа.
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 |
DATA ls_bkpf TYPE bkpf. DATA lv_name TYPE thead-tdname. DATA lt_lines TYPE TABLE OF tline. DATA lv_string TYPE string. ... CONCATENATE ls_bkpf-bukrs ls_bkpf-belnr ls_bkpf-gjahr INTO lv_name RESPECTING BLANKS. CALL FUNCTION 'READ_TEXT' EXPORTING id = '0001' language = sy-langu name = lv_name object = 'BELEG' TABLES lines = lt_lines EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. IF sy-subrc EQ 0. CALL FUNCTION 'IDMX_DI_TLINE_INTO_STRING' EXPORTING it_tline = lt_lines IMPORTING ev_text_string = lv_string. WRITE / lv_string. ELSE. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. |