‎2008 May 30 9:13 PM
Hi,
I have problem in uploading xml file into itab.
Here is the code
begin of GS_STRING,
STR(72) type C,
end of GS_STRING,
GT_STRING like standard table of GS_STRING,
call function 'GUI_UPLOAD'
EXPORTING
FILENAME = FILE_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = GT_STRING
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
others = 17.
if SY-SUBRC <> 0.
message I499(SY) with 'File upload failed'.
stop.
endif.
endif.In debuggin mode, i can see the itab uploaded with xml payload. But in that same place, the hexadecimal format has double zeros 00 after each character.
XML message : <?xml
Correct Hexadecimal : 3C3F786D6C
Hexadecimal in itab : 3C003F0078006D006C00
This makes the resultant xml invalid.
can anyone help me to solve this?
Thanks,
Uma
Edited by: Uma Maheswari on May 30, 2008 4:15 PM
‎2008 May 30 9:27 PM
Try passing codepage while uploading the xml.
I am not sure which code page to try.
thnx,
Ags.
‎2008 May 30 10:32 PM
Thanks.
After changing the code page, double zeros are removed.
But now, only first 144 characters of xml are present. so again the xml is invalid.
If you have any suggestions, pls let me know
Thanks,
Uma
‎2008 May 30 10:39 PM
Did you checked with all possible code pages?
One of them will definitely help you in uploading whole XML without those double zeros.
Also try UTF-8.
thnx,
Ags.
‎2008 May 30 10:59 PM
hi,
I used code page 4103. All double zeros are removed. But the problem was with the size of xml uploaded in itab.
Then, by increasing length of itab string element, the xml uploaded correctly.
My confusion is about varying uploaded xml size w.r.t. codepage changes.
Thanks,
Uma
Edited by: Uma Maheswari on May 30, 2008 6:02 PM
‎2008 May 31 8:57 AM
what do you want to do with the uploaded XML?
i use the following
constants: line_size type i value 255.
data: begin of xml_tab occurs 0,
raw(line_size) type x,
end of xml_tab,
file type string,
size type i.
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab
exceptions
others = 1.
‎2008 May 31 9:16 AM
hi check this...
DATA:
lt_t005 TYPE STANDARD TABLE OF t005.
TYPES:
xmlline(1024) TYPE x.
DATA:
lt_xml TYPE STANDARD TABLE OF xmlline.
SELECT * FROM t005 INTO TABLE lt_t005.
CALL TRANSFORMATION id
SOURCE data_node = lt_t005
RESULT XML lt_xml.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = 'C:\table.xml'
filetype = 'BIN'
CHANGING
data_tab = lt_xml.
regards,
venkat
‎2008 May 31 9:28 AM
hi venkat appikonda ,
the requestor is talking about GUI_UPLOAD