2006 Jun 13 10:49 AM
Hi Experts,
I tried to download data from SAP in XML Format to Application server, but i am getting error.
This is the code.
l_streamfactory = l_ixml->create_stream_factory( ).
l_ostream = l_streamfactory->create_ostream_itable(
table = l_xml_table ).
*To Change the Encoding Type to UTF-8
s_encoding_type = 'utf-8'.
encoding = l_ixml->create_encoding( character_set = s_encoding_type
byte_order = 0 ).
call method l_ostream->set_encoding
exporting encoding = encoding.
*Rendering the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
*Saving the XML document
l_xml_size = l_ostream->get_num_written_raw( ).
data filepath TYPE string.
data filedir TYPE string.
data filename TYPE string.
data hhh type xml_line.
filedir = 'C:\usr\sap\PDG\DVEBMGS00\data\'.
filename = 'ZHR'.
CONCATENATE filedir filename '.xml' INTO filepath.
break-point.
OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
LOOP AT l_xml_table into hhh.
TRANSFER hhh TO filepath.
ENDLOOP.
CLOSE DATASET filepath.
Can you please help me.
Thanks in Advance.
Murali krishna K
Hi Experts,
I tried to download data from SAP in XML Format to Application server, but i am getting error.
This is the code.
l_streamfactory = l_ixml->create_stream_factory( ).
l_ostream = l_streamfactory->create_ostream_itable(
table = l_xml_table ).
*To Change the Encoding Type to UTF-8
s_encoding_type = 'utf-8'.
encoding = l_ixml->create_encoding( character_set = s_encoding_type
byte_order = 0 ).
call method l_ostream->set_encoding
exporting encoding = encoding.
*Rendering the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
*Saving the XML document
l_xml_size = l_ostream->get_num_written_raw( ).
data filepath TYPE string.
data filedir TYPE string.
data filename TYPE string.
data hhh type xml_line.
filedir = 'C:\usr\sap\PDG\DVEBMGS00\data\'.
filename = 'ZHR'.
CONCATENATE filedir filename '.xml' INTO filepath.
break-point.
OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
LOOP AT l_xml_table into hhh.
TRANSFER hhh TO filepath.
ENDLOOP.
CLOSE DATASET filepath.
Can you please help me.
Thanks in Advance.
Murali krishna K
2006 Jun 13 10:54 AM
DATA rec(80). "Adjust as per requirement/OS limits
OPEN DATASET filepath FOR OUTPUT IN <b>TEXT MODE ENCODING DEFAULT.</b>
LOOP AT l_xml_table into hhh.
TRANSFER hhh TO filepath.
ENDLOOP.
CLOSE DATASET filepath.
2006 Jun 13 11:24 AM
Hi Kishna,
OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
This Statement is giving error.
Type ...filter..message...expected after mode.
Thanks,
Murali K
2006 Jun 13 4:05 PM
Is the affected System a Unicode system? which basis release ?
2006 Jun 14 3:56 AM
Hi Mike,
It is R/3 Release 4.6C
How to find whethe it is unicode system or not.
Thanks,
Murali Krishna K
2006 Jun 14 7:44 AM
4.6C does not support Unicode...
You have to OPEN the DATASET without the addition "ENCODING DEFAULT". This addition is not supported in 4.6 systems.
2006 Jun 29 10:36 AM
Hi Murali,
I have the same problem: were you able to solve it?
dannyR
2007 Oct 12 8:56 AM
Now i read the xml files from the application server ,i met "//uploadtest/test.xml cann't open" error. And the test.xml content chinese characters
OPEN DATASET l_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT .
IF sy-subrc <> 0.
WRITE:/ 'invalid file path'.
ENDIF.
DO.
READ DATASET l_filename INTO l_xml_line.
IF sy-subrc EQ 0.
APPEND l_xml_line TO l_xml_table.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET l_filename.
2006 Jun 13 11:08 AM
2006 Jun 13 11:21 AM
Hi Mike,
Error is this one.
File "C:\usr\sap\PDG\DVEBMGS00\data\ZHR.xml" could not be closed ".
The current program "ZBPO_SUBPOOL " had to be terminated because
a capacity limit has been reached.
Thanks,
Murali k
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |