1个回答
展开全部
例子:
data: begin of i_stxh occurs 0,
tdobject like stxh-tdobject,
tdname like stxh-tdname,
tdid like stxh-tdid,
tdspras like stxh-tdspras,
end of i_stxh.
select tdobject tdname tdid tdspras
into corresponding fields of table i_stxh
from stxh
where tdname = p_ebeln
and tdspras = '1'
AND tdid = 'F01'
and tdobject = 'EKKO'.
clear i_stxh.
loop at i_stxh.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
LANGUAGE = i_stxh-tdspras
ID = I_stxh-tdid
NAME = I_stxh-tdname
OBJECT = I_stxh-tdobject
TABLES
LINES = TEXT " LIKE TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENC_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.
data: begin of i_stxh occurs 0,
tdobject like stxh-tdobject,
tdname like stxh-tdname,
tdid like stxh-tdid,
tdspras like stxh-tdspras,
end of i_stxh.
select tdobject tdname tdid tdspras
into corresponding fields of table i_stxh
from stxh
where tdname = p_ebeln
and tdspras = '1'
AND tdid = 'F01'
and tdobject = 'EKKO'.
clear i_stxh.
loop at i_stxh.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
LANGUAGE = i_stxh-tdspras
ID = I_stxh-tdid
NAME = I_stxh-tdname
OBJECT = I_stxh-tdobject
TABLES
LINES = TEXT " LIKE TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENC_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.
来自:求助得到的回答
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询