REPORT z_barry_test MESSAGE-ID oo LINE-SIZE 1023 .
DATA: xstr TYPE xstring ,
bin_table TYPE TABLE OF x255 WITH HEADER LINE,
file_len TYPE i,
itab TYPE STANDARD TABLE OF smum_xmltb WITH HEADER LINE,
return TYPE STANDARD TABLE OF bapiret2 .
*CALL FUNCTION 'GUI_UPLOAD'
* EXPORTING
* filename = 'C:\dw.xml'
* filetype = 'BIN'
* IMPORTING
* filelength = file_len
* TABLES
* data_tab = bin_table
* EXCEPTIONS
* OTHERS = 17.
*CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
* EXPORTING
* input_length = file_len
* IMPORTING
* buffer = xstr
* TABLES
* binary_tab = bin_table
* EXCEPTIONS
* failed = 1
* OTHERS = 2.
DATA : dname(128) TYPE c VALUE '/usr/sap/CBR/DVEBMGS00/dw.xml'.
OPEN DATASET dname FOR INPUT IN BINARY MODE .
READ DATASET dname INTO xstr .
CLOSE DATASET dname.
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = xstr
TABLES
xml_table = itab
return = return.
LOOP AT itab.
WRITE :/ itab-hier ,
itab-type,
(20) itab-cname ,
itab-cvalue.
ENDLOOP.
阅读(3119) | 评论(0) | 转发(0) |