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

Transfer XML File

Former Member
0 Likes
586

Hi all,

I have a XML file in the aplication server. I need to transfer this file to another path. I´m using the open dataset for this operation. The process is fine. But When I Access the XML file for internet explorer, the XML cannot open.

The code XML in both are identical. I don´t know if is right to use open data set for transfer XML file in the aplication server.

Great,

4 REPLIES 4
Read only

Former Member
0 Likes
534

Hi,

Try something like this:

clear ta_rec[].

ta_rec-record = 'echo off'.

append ta_rec.

concatenate 'copy' '
server1\files\f1.txt' '
server1\files\f2.txt' into sal separated by space.

ta_rec-record = sal.

append ta_rec.

data retcode type i.

OPEN DATASET DIRFILE FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.

loop at ta_rec.

TRANSFER ta_rec TO DIRFILE.

endloop.

CLOSE DATASET DIRFILE.

Open Dataset DIRFILE for input

IN TEXT MODE ENCODING NON-UNICODE

filter dirfile.

CLOSE DATASET DIRFILE.

otherwise the folder is not shared.

Read only

Former Member
0 Likes
534

Hi Marcelo,

Can you show us your code?

Regards,

ravi

Read only

0 Likes
534

See my code below:

***Get the XML data in the aplication server

OPEN DATASET p_arq FOR INPUT IN BINARY MODE.

CHECK sy-subrc = 0.

DO.

READ DATASET p_arq INTO t_xml.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND t_xml.

CLEAR t_xml.

ENDDO.

CLOSE DATASET p_arq.

***Moving XML data for another path in the aplication server

OPEN DATASET w_filename FOR OUTPUT in BINARY MODE.

IF sy-subrc = 0.

LOOP AT t_xml.

TRANSFER t_xml TO w_filename.

ENDLOOP.

ENDIF.

CLOSE DATASET w_filename.

Read only

Former Member
0 Likes
534

Solved