读取长文本

Posted on 2023-05-25 23:57  Chris的博客  阅读(11)  评论(0编辑  收藏  举报
DATA:ls_thead TYPE thead.
CLEAR:ls_thead.
ls_thead-tdid = 'Z006'.
ls_thead-tdspras = sy-langu.
ls_thead-tdname = <fs_alv>-vbeln.
ls_thead-tdobject = 'VBBK'.
PERFORM frm_read_text USING ls_thead CHANGING <fs_alv>-zfpbz.
FORM frm_read_text USING ps_thead TYPE thead CHANGING ps_text. DATA:lt_tlins TYPE STANDARD TABLE OF tline WITH HEADER LINE. CALL FUNCTION 'READ_TEXT' EXPORTING client = sy-mandt id = ps_thead-tdid language = ps_thead-tdspras name = ps_thead-tdname object = ps_thead-tdobject * ARCHIVE_HANDLE = 0 * LOCAL_CAT = ' ' * IMPORTING * HEADER = * OLD_LINE_COUNTER = TABLES lines = lt_tlins 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 = 0. LOOP AT lt_tlins. ps_text = ps_text && lt_tlins-tdline. CONDENSE ps_text. ENDLOOP. ENDIF. ENDFORM.