Skip to Content
0
Former Member
May 07, 2008 at 11:30 AM

Error in dowloading the File when Sheduled in background.

18 Views

Dear Freinds,

I have written File Interface program . Iam running the program in foreground and in the bacground . Iam able to download theprogram in presentation server as well in application server . However when iam scheduling in background the job has been finished , but when i see the job log i can see that iam getting the below erroror.

Error Downloading the File , so could any one let meknow what would the reason iam using the below code for open data set.

IF ( CSV_OUTPUT is NOT Initial ).

*1) Delete the existing file (if it exists)

TRY.

*2) Create new file on the application server.

OPEN DATASET ls_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc <> 0.

WRITE: / 'Open File : Error'.

ELSE.

WRITE: / 'Open File : Successful'.

LOOP AT csv_OUTPUT into wa_csv_output.

TRANSFER wa_csv_output TO ls_file.

ENDLOOP.

ENDIF.

*3) close the file connection.

CLOSE DATASET ls_file.

IF sy-subrc <> 0.

WRITE: / 'Close File : Error'.

ELSE.

WRITE: / 'Closed File: Successful'.

ENDIF.

*4) handle exceptions

CATCH CX_SY_FILE_ACCESS_ERROR INTO o_ex_file.

ls_exec = o_ex_file->IF_MESSAGE~GET_LONGTEXT( ).

WRITE:/ 'Exception occured', ls_exec.

RETURN.

ENDTRY.

ELSE.

WRITE:/ 'No Data found.'.

RETURN.

ENDIF.

Please if anybody could help me out it would great help as this urgent.

Thanks & regards

Madhuri