Application Development 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: 

XML file creation in application server

Former Member
0 Kudos

Hi Experts,

I have created an XML DOM tree and it is saved in an internal table of type

BEGIN OF xml_line,

data(256) TYPE x,

END OF xml_line.

I need to store this in the application server. The code that I'm using to copy the contents are as follows:

OPEN DATASET w_xml_out_file FOR OUTPUT

IN BINARY MODE.

IF sy-subrc EQ 0.

CLEAR: f_xml_table.

LOOP AT t_xml_table INTO f_xml_table.

TRANSFER f_xml_table TO w_xml_out_file.

ENDLOOP.

CLOSE DATASET w_xml_out_file.

ENDIF.

I downloaded this file from the application server onto my presentation server and checked its contents.

The problem is that all the data is not present in this output XML file. It is taking only some data.

When I use the same table to generate an output file directly on the presentation server, it does not have any problems.

Any help on the above issues is appreciated.

Regards

-Joe

1 ACCEPTED SOLUTION

franois_henrotte
Active Contributor
0 Kudos

which conversion do you apply to your data in order to fill table t_xml_table ?

should be utf-8 and set the encoding properly at the beginning of the file

5 REPLIES 5

franois_henrotte
Active Contributor
0 Kudos

which conversion do you apply to your data in order to fill table t_xml_table ?

should be utf-8 and set the encoding properly at the beginning of the file

0 Kudos

Hi François Henrotte,

I've already done that.

0 Kudos

May be try to define as below and see what happens.

types : gty_line_t(100) TYPE x.

data : gt_restab TYPE STANDARD TABLE OF gty_line_t,

<gs_restab> LIKE LINE OF gt_restab.

OPEN DATASET l_file_name FOR OUTPUT IN BINARY MODE .

IF sy-subrc = 0.

LOOP AT gt_restab ASSIGNING <gs_restab>.

TRANSFER <gs_restab> TO l_file_name.

endloop.

endif.

CLOSE DATASET l_file_name.

0 Kudos

I was checking my file contents in AL11.

I downloaded this same file in AL11 onto the presentation server to check its contents.

I used the transaction CG3Y to do the above.

I was downloading the file in ASC format all this while.

I downloaded the file in BIN format and now it is showing the complete XML file without any errors.

Thank You for all your help.

If some1 can throw more light on why the file must be downloaded in the BIN format and not in the ASC it would be great.

0 Kudos

ASC Format is related to .txt file and BIN format supports .xml and others too.

Thanks

Seshu