09-26-2008 12:38 AM
I'm trying to convert an internal table to an xml file. This file will be downloaded to a unix server. Can someone help?
09-26-2008 12:58 AM
09-26-2008 8:02 PM
I think what you gave me works for downloading in the foreground to your hard drive. I want to do a transfer to a unix directory.
09-26-2008 9:24 PM
Hello Linda,
You can combine the code given by Mahalakshmi with something like this:
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = 'YOUR_LOGICAL_FILE_NAME
parameter_1 = l_file_name_xml
IMPORTING
file_name = l_file_server
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
TRY.
OPEN DATASET l_file_server FOR OUTPUT. "<IN TEXT MODE> <ENCODING DEFAULT>.
ENDTRY.
IF sy-subrc = 0.
LOOP AT lt_xml INTO ls_xml.
TRANSFER ls_xml TO l_file_server.
ENDLOOP.
CLOSE DATASET l_file_server.
ENDIF.
ENDIF.
You need to have the server path defined (look at the paths with tcode AL11) and the file logical name with tcode FILE
Best regards,
Andri
09-30-2008 12:36 AM
10-14-2008 5:20 PM
Thanks, but it's not working correctly. It splits up the file within the brackets. This is just an example. It right justifies the amount and leaves spaces. Basically, it's not formatting correctly. Is there something that I'm missing?
A name contained an invalid character. Error processing resource 'file:///C:/ONESD/xml_inv.xml'. Line 4, Position 9
YPE_DESC>Non-City Customer</FUND_TYPE_DESC><APPL_CODE>A00</APPL_CODE><APPL_CODE_NAME>SDDPC-Corp E...