双击文本内容->转到'表头':
1.如果是抬头描述
会看到:
文本名:0080000663(vbeln)
标识:0001(表抬头)
文本对象:VBBK(销售 标题文件)
2.如果是行项目描述
会看到:
文本名:0080000663000010(vbeln + posnr)
标识:0001(物料销售文字)"这个ID在SAP系统配置为'ZP02'
文本对象:VBBP(销售 项目文件)
data : ls_tdname like rstxt-tdname.
data : lt_lines like table of tline with header line.
clear lt_lines[].
clear wa_belnr-text.
concatenate wa_belnr-vbeln wa_belnr-posnr into ls_tdname.
call function 'READ_TEXT'
exporting
client = sy-mandt
id = 'ZP02' "SAP系统配置
language = '1'
name = ls_tdname
object = 'VBBP'
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 <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at lt_lines.
condense : lt_lines-tdline.
concatenate wa_belnr-text lt_lines-tdline into wa_belnr-text .
endloop.
*--------------------------------------------------------------------
*------------取表头文本说明-----------------------------------------------
data : ls_adname like rstxt-tdname.
data : lt_alines like table of tline with header line.
clear: lt_alines[].
* CONCATENATE ls_adname = wa_belnr-vbeln INTO ls_adname.
ls_adname = wa_belnr-vbeln.
call function 'READ_TEXT'
exporting
client = sy-mandt
id = 'ZP02'
language = '1'
name = ls_adname
object = 'VBBK'
tables
lines = lt_alines
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.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at lt_alines.
condense : lt_alines-tdline.
concatenate wa_belnr-text1 lt_alines-tdline into wa_belnr-text1.
endloop.
评论