本站网友 发表时间:2008-01-29 13:46:50 |
|
老白,XML下载那个程序给我帮助很大,可否再做一个XML上载的?和XML解析,谢谢!! |
最简单的用法:
..
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = g_xml_fullpath
filetype = 'BIN' " BIN OR ASC
IMPORTING
filelength = xml_document_size
CHANGING
data_tab = xml_xtable[]
EXCEPTIONS
OTHERS = 1.
data me_xml TYPE REF TO cl_xml_document .
CREATE OBJECT me_xml.
CALL METHOD me_xml->create_with_table
EXPORTING
table = xml_xtable[]
size = xml_document_size
RECEIVING
retcode = subrc.
CALL METHOD me_xml->get_data
IMPORTING
retcode = subrc
CHANGING
dataobject = itab.
....
最好先根据XML的格式定义一个结构,itab就是根据这个结构建的内表
这个方法不能随心所欲的解析到某个Node,如果需要解析的话,可以参考程序:
BCCIIXMLT1
BCCIIXMLT2
BCCIIXMLT3
BCCIIXMLT4
CKECP_IMPORT_MODEL ...等
阅读(6568) | 评论(6) | 转发(0) |