strans代码simpletransformation
"">
"ROOT"/>
"line" ref=".ROOT">
"$line.ebeln"/>
"$line.ebelp"/>
se38的代码
REPORT ZTHOMAS_STRANS_EKKO
.
DATA:xml_string
TYPE string
.
DATA:BEGIN OF line,
ebeln
like ekpo
-ebeln
,
ebelp
like ekpo
-ebelp
,
END OF line.
DATA itab
LIKE TABLE OF line.
DATA result
LIKE itab
.
DATA:BEGIN OF it_xml
OCCURS 0,
line(100) TYPE c,
END OF it_xml
.
DATA:w_len
TYPE i.
SELECT ebeln ebelp
into CORRESPONDING
FIELDS OF TABLE itab
FROM ekpo
UP TO 10 ROWS.
CALL TRANSFORMATION ZTHOMAS_STRANS_EKKO
SOURCE root
= itab
RESULT XML xml_string
.
WRITE: /
'转换完毕'.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
TEXT = xml_string
IMPORTING
LENGTH
= w_len
TABLES
FTEXT_TAB
= it_xml
.
WRITE: /
'xml格式转换完毕'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME
= 'c:\xmlcall.xml'
FILETYPE
= 'BIN'
IMPORTING
FILELENGTH
= w_len
TABLES
DATA_TAB
= it_xml
.
生成xml文件
4320000001
00010
4320000002
00010
4320000003
00010
4320000003
00020
4320000004
00010
4320000004
00020
4320000100
00010
4320000101
00010
4320000102
00010
4320000103
00010
阅读(934) | 评论(0) | 转发(0) |