FORM frm_read_txt USING vbeln LIKE vbak-vbeln
CHANGING txt .
DATA :lc_name TYPE thead-tdname,
lit_lines TYPE TABLE OF tline,
lwa_lines TYPE tline.
CLEAR: lit_lines ,
lc_name,
lwa_lines.
lc_name = vbeln.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = '0001'
language = sy-langu
name = lc_name
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
lines = lit_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 = 4.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = '0001'
language = sy-langu
name = lc_name
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
lines = lit_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
ENDIF.
LOOP AT lit_lines INTO lwa_lines.
* GWA_OUTPUT-RISE_TEXT = LWA_LINES-TDLINE .
CONCATENATE txt lwa_lines-tdline INTO txt.
ENDLOOP.
ENDFORM.
转载于:https://www.cnblogs.com/eagle-dtq/p/5416159.html