ABAP read_text 使用 快速开始
DATA : lv_name TYPE thead-tdname.
PERFORM frm_read_text USING '0001' lv_name 'RBKP' CHANGING <fs_itab>-zfpdz.
*&---------------------------------------------------------------------*
*& Form frm_read_text
*&---------------------------------------------------------------------*
*& 获取长文本
*&---------------------------------------------------------------------*
*& --> c_text
*&---------------------------------------------------------------------*
FORM frm_read_text USING fid fname fobject CHANGING c_text.
DATA: lv_str TYPE string.
DATA: lv_tdname LIKE thead-tdname.
DATA: lt_tline TYPE TABLE OF tline.
DATA: ls_tline TYPE tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = fid " 文本ID的值
language = sy-langu " 语言的值 1表示中文
name = fname " 文本名的值
object = fobject " 文本对象的值
TABLES
lines = lt_tline
EXCEPTIONS
" EXCEPTIONS必须写,否则表头文本为空时程序将dump
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.
" MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
" WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT lt_tline INTO ls_tline.
CONCATENATE lv_str ls_tline-tdline INTO lv_str.
ENDLOOP.
ENDIF.
c_text = lv_str.
ENDFORM.