Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

itab to xml help

Former Member
0 Likes
522

Hi,

i do this code like below and in that append commend i get in table sign like :

㼼浸敶獲潩㵮ㄢ〮•湥潣楤杮∽瑵ⵦ∸㸿㰊獡㩸扡灡砠汭獮愺硳∽

what can be the problem:

Regards

SELECT *

FROM pa0000

INTO TABLE it_p.

go_ixml = cl_ixml=>create( ).

go_stream_factory = go_ixml->create_stream_factory( ).

go_encoding = go_ixml->create_encoding( character_set = gc_encoding

byte_order = 0 ).

go_resstream =

go_stream_factory->create_ostream_cstring( gd_result ).

CALL METHOD go_resstream->set_encoding

EXPORTING

encoding = go_encoding.

*----


Xml Transformieren

CALL TRANSFORMATION id

SOURCE itab = it_p

RESULT XML go_resstream.

APPEND gd_result TO gt_xml.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = 'C:\Documents and Settings\Desktop\XML_TEST'

CHANGING

data_tab = gt_xml

EXCEPTIONS

file_write_error = 1

OTHERS = 24.

Hi,

i do this code like below and in that append commend i get in table sign like :

㼼浸敶獲潩㵮ㄢ〮•湥潣楤杮∽瑵ⵦ∸㸿㰊獡㩸扡灡砠汭獮愺硳∽

what can be the problem:

Regards

SELECT *

FROM pa0000

INTO TABLE it_p.

go_ixml = cl_ixml=>create( ).

go_stream_factory = go_ixml->create_stream_factory( ).

go_encoding = go_ixml->create_encoding( character_set = gc_encoding

byte_order = 0 ).

go_resstream =

go_stream_factory->create_ostream_cstring( gd_result ).

CALL METHOD go_resstream->set_encoding

EXPORTING

encoding = go_encoding.

*----


Xml Transformieren

CALL TRANSFORMATION id

SOURCE itab = it_p

RESULT XML go_resstream.

APPEND gd_result TO gt_xml.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = 'C:\Documents and Settings\Desktop\XML_TEST'

CHANGING

data_tab = gt_xml

EXCEPTIONS

file_write_error = 1

OTHERS = 24.

2 REPLIES 2
Read only

Former Member
0 Likes
479

Hi All,

Any idea?

Regards

Read only

0 Likes
479

Hi,

I don't know if it is too late. If so, I just hope that can help somebody else.

Here is the code I am using.

DATA:
  it_pa0000 TYPE STANDARD TABLE OF  pa0000,
  l_string  TYPE string,
  it_tab    TYPE TABLE OF string.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_pa0000 FROM pa0000.

CALL TRANSFORMATION id SOURCE output = it_pa0000
                   RESULT XML l_string.

APPEND l_string TO it_tab.

CALL METHOD cl_gui_frontend_services=>gui_download
  EXPORTING
    filename         = 'C:\TEMP\TEST.XML'
  CHANGING
    data_tab         = it_tab
  EXCEPTIONS
    file_write_error = 1
    OTHERS           = 24.

Regards