Gracias por tu ayuda
Precisamente estaba haciendo lo que dices....
Solo que si es obligatorio el uso de la funcion, puesto que la funcion me devuelve un log, que sera usado por WORK FLOW....
Te muesto lo que llevo....
PRIMERO LLEVO EL ARCHIVO A PC (Como prueba)...
* Method Export file to PC
CALL METHOD r_gui->gui_download
EXPORTING
filename = c_file
filetype = 'ASC'
write_field_separator = 'X'
CHANGING
data_tab = it_txt[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
OTHERS = 24.
IF sy-subrc NE 0.
MESSAGE s166 WITH 'Error.Archivo no pudo ser generado'(e01).
ELSE.
MESSAGE s166 WITH 'Archivo ha sido generado'(e02) c_file.
ENDIF.
DESPUES CREO EL ARCHIVO .BAT
REFRESH itab.
CONCATENATE 'CD' w_path INTO itab-doscmd SEPARATED BY space.
APPEND itab.
TRANSLATE w_direc TO LOWER CASE.
MOVE w_direc TO itab-doscmd.
APPEND itab.
IF NOT w_inst1 IS INITIAL.
itab-doscmd = w_inst1.
APPEND itab.
ENDIF.
IF NOT w_inst2 IS INITIAL.
itab-doscmd = w_inst2.
APPEND itab.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = 'C:\OPEN_ORDER.BAT'
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
Y AHORA.......... Por lo que me indicas puedo ejecutar el archivo bat en la funcion correcto????
|