ABAP读取采购申请的项⽬⽂本READ_TEXT DATA: it_texttable TYPE TABLE OF tline-tdline WITH HEADER LINE,
it_tem_table TYPE TABLE OF tline WITH HEADER LINE.
DATA:hk_text(50).
DATA: BEGIN OF itb_s18 OCCURS0.
INCLUDE STRUCTURE thead.
DATA: END OF itb_s18.
DATA: BEGIN OF flines OCCURS0.
INCLUDE STRUCTURE tline.
DATA: END OF flines.
LOOP AT tab_5 ASSIGNING <fs>. "tab_5 内表
CLEAR ebelnkp.
CONCATENATE <fs>-banfn <fs>-bnfpo INTO ebelnkp. "banfn采购申请号 bnfpo项次
SELECT * FROM stxl INTO CORRESPONDING FIELDS OF TABLE itb_s18
WHERE tdobject = 'EBAN'AND tdname = ebelnkp.
CLEAR hk_text.
LOOP AT itb_s18.
CLEAR hk_text.
PERFORM frm_read_text USING'B01' itb_s18-tdname 'EBAN'CHANGING hk_text .
<fs>-mfrpn = hk_text.
ENDLOOP.
ENDLOOP.
FORM frm_read_text USING fid fname fobject CHANGING hk_text .
CALL FUNCTION'READ_TEXT'
EXPORTING
client = sy-mandt
id = fid
language = sy-langu
name = fname
object = fobject
TABLES
lines = flines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT flines.
it_tem_table-tdline = flines-tdline.
APPEND it_tem_table.
ENDLOOP.
*Read_text读取长⽂本中<(>&<)>符号转换成正确的'&'符号
CALL FUNCTION'CONVERT_ITF_TO_STREAM_TEXT'
EXPORTING
language = sy-langu
TABLES
itf_text = it_tem_table
text_stream = it_texttable.
IF sy-subrc = 0AND it_texttable[] IS NOT INITIAL.
READ TABLE it_texttable INTO hk_text INDEX 1.
ENDIF.
ENDFORM. "FRM_READ_TEXT
申请博客帐号
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论