Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

background job problem

hai

i create the data upload program but when i run it as background job its not wking... hoh should i fix that problem?

i use the function GUI_UPLOAD....to upload the data ...

form get_data_from_as400_file .

v_filename = dataset.

call function 'GUI_UPLOAD'

exporting

filename = v_filename

filetype = 'ASC'

has_field_separator = 'X'

tables

data_tab = it_as400

exceptions "+

file_open_error = 1 "+

file_read_error = 2 "+

no_batch = 3 "+

gui_refuse_filetransfer = 4 "+

invalid_type = 5 "+

no_authority = 6 "+

unknown_error = 7 "+

bad_data_format = 8 "+

header_not_allowed = 9 "+

separator_not_allowed = 10 "+

header_too_long = 11 "+

unknown_dp_error = 12 "+

access_denied = 13 "+

dp_out_of_memory = 14 "+

disk_full = 15 "+

dp_timeout = 16 "+

others = 17. "+

case sy-subrc.

when '1'. "+

write: /'ERROR WHILE OPENING THE FILE'.

when '2'. "+

write: /'ERROR WHILE READING THE FILE'.

when '3'. "+

write: /'NO BATCH'.

when '4'. "+

write: /'ERROR IN FILE TRANSFERING'.

when '5'. "+

write: /'INVALID TYPE'.

when '6'. "+

write: /'NO AUTHORITY TO RUN THIS PROGRAM'.

when '7'. "+

write: /'UNKNOWN ERROR'.

when '8'. "+

write: /'BAD DATA FORMAT'.

when '9'. "+

write: /'HEADER NOT ALLOWED'.

when '10'. "+

write: /'SEPERATOR NOT ALLOWED'.

when '11'. "+

write: /'TOO LONG HEADER'.

when '12'. "+

write: /'UNKNOWN DP ERROR'.

when '13'. "+

write: /'ACCESS DENIED'.

when '14'. "+

write: /'DP OUT OF MEMORY'.

when '15'. "+

write: /'DISK IS FULL'.

when '16'. "+

write: /'DP TIME OUT'.

when '17'. "+

write: /'OTHERS'.

endcase.

if sy-subrc <> 0.

stop.

endif.

endform. " get_data_from_as400_file

regard

Tags:
Former Member replied

Hi nawanandana,

well, function GUI_UPLOAD will not work as a background process (nor will GUI_DOWNLOAD), because these functions need the presentation server to be available, in order to get/put the file. Instead, use OPEN/CLOSE DATASET or FTPs if the source file is allocated in some cluster available thru FTP (not your local drives).

I hope it helps. Best regards,

Alvaro

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question