|
回复 #2 sbrui 的帖子
第1页#5那段代码照抄就可用
#9两种修改方法用任一种都可以,却同时用了两种
真是不好意思,可能是我说得不够清楚.为了避免再错,我把修改后的代码全部贴出来吧
data: it_header type standard table of zso_header_row initial size 0 with header line,
it_detail type standard table of ZSO_DETAIL_ROW initial size 0 with header line,
it_text type standard table of tline initial size 0 with header line,
wa_header type zso_header_row,
wa_detail type ZSO_DETAIL_ROW,
wa_text type tline,
text_name like thead-tdname .
select *
into corresponding fields of wa_detail
from vbak "业务数据表
inner join vbap on "项目数据表
vbak~vbeln = vbap~vbeln
where vbak~vbeln = p_vbeln.
append wa_detail to it_detail.
endselect.
loop at it_detail into wa_detail.
concatenate wa_detail-vbeln wa_detail-posnr into text_name.
write: / wa_detail-vbeln, wa_detail-posnr, text_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = '600'
ID = '0001'
LANGUAGE = '1'
NAME = text_name
OBJECT = 'VBBP'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
LINES = it_text
* 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.
endloop. |
|