04-29-2009 12:16 PM
Hello Seniors,
I have a requirement in which I have to upload an XML File to application server through a background job, then download the file from there to the presentation server. My issue is that I am able to upload and download the file but the format and alignment of the file is getting disturbed and the XML file doesn't open up after downloading. I need to download the XML file as it is (retain the XML alignment), so that I can be able to open it after downloading to the presentation server. Could you please help me out of this.
Thanks and regards,
Chaitanya.
04-29-2009 12:46 PM
Take the pseudo code...
****TRANSEFERING THE FILE TO APPLCATION SERVER
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
IF sy-subrc = 0 .
LOOP AT it_error1 INTO wa_error1 .
TRANSFER wa_error1-str TO p_file .
CLEAR:wa_error1 .
ENDLOOP .
CLOSE DATASET p_file .
IF sy-subrc = 0 .
MESSAGE 'Check The Order Eror file ' TYPE 'S' .
ENDIF.
ELSE.
MESSAGE 'Error While Opening The File Path' TYPE 'S'.
ENDIF.
*Retreiving all the files in the specified application directory
DATA: wa_file(1000) TYPE c,
text(50) TYPE c,
file_name(100) TYPE c.
CLEAR:wa_file,
text,
file_name.
*& location
CALL FUNCTION 'RZL_READ_DIR'
EXPORTING
name = c_path
TABLES
file_tbl = it_file
EXCEPTIONS
argument_error = 1
not_found = 2
send_error = 3
system_failure = 4
OTHERS = 5.
OPEN DATASET file_name FOR INPUT IN TEXT MODE ENCODING DEFAULT.
READ DATASET file_name INTO wa_file.
CLOSE DATASET file_name .
04-29-2009 12:46 PM
Take the pseudo code...
****TRANSEFERING THE FILE TO APPLCATION SERVER
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
IF sy-subrc = 0 .
LOOP AT it_error1 INTO wa_error1 .
TRANSFER wa_error1-str TO p_file .
CLEAR:wa_error1 .
ENDLOOP .
CLOSE DATASET p_file .
IF sy-subrc = 0 .
MESSAGE 'Check The Order Eror file ' TYPE 'S' .
ENDIF.
ELSE.
MESSAGE 'Error While Opening The File Path' TYPE 'S'.
ENDIF.
*Retreiving all the files in the specified application directory
DATA: wa_file(1000) TYPE c,
text(50) TYPE c,
file_name(100) TYPE c.
CLEAR:wa_file,
text,
file_name.
*& location
CALL FUNCTION 'RZL_READ_DIR'
EXPORTING
name = c_path
TABLES
file_tbl = it_file
EXCEPTIONS
argument_error = 1
not_found = 2
send_error = 3
system_failure = 4
OTHERS = 5.
OPEN DATASET file_name FOR INPUT IN TEXT MODE ENCODING DEFAULT.
READ DATASET file_name INTO wa_file.
CLOSE DATASET file_name .
04-29-2009 1:05 PM
Thats impossible. A report running in background cannot save a file on a presentation server, only on an application server.