11-15-2007 4:37 PM
Hi,
I am using GUI_DOWNLOAD FM inside my program. I need to download the internal table into 'dbf' file format. But while executing I am getting sy-subrc = 21 which is 'CONTROL FLUSH ERROR'. Could anyone please help me on this issue?
Regards,
Gunasree
11-15-2007 4:49 PM
11-15-2007 4:49 PM
11-15-2007 4:51 PM
Hi Rich,
We are running this in foreground.
Thanks,
Gunasre
11-15-2007 5:03 PM
11-15-2007 5:30 PM
Hi,
Structure of internal table ITAB is
FIELD1 CHAR 18
FIELD2 CHAR 18
FIELD3 CHAR 40
FIELD4 CHAR 40
FIELD5 CHAR 10
FIELD6 CHAR 40
FIELD7 CHAR 12
FIELD8 DATS 8
FIELD9 CHAR 10
Actually all this code lies into the RFC in which data is coming from oracle through XI.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = p_path
filetype = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
IMPORTING
FILELENGTH =
TABLES
*{ REPLACE RESK900114 2
*\ data_tab = p_mfg_diff
data_tab = ITAB[]
*} REPLACE
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
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanxs
Gunasree
11-15-2007 5:47 PM
<i>Actually all this code lies into the RFC in which data is coming from oracle through XI.</i>
If this is not being called from within SAPgui, then you will have a problem. This function is highly dependent on the SAPgui, and it must be called when using SAPgui.
You can not call this remotely from any other source.
Regards,
Rich Heilman
11-15-2007 4:51 PM
If you are running in background, this is your issue. What you have here is a frontend dependent function module, which means it uses components in SAPgui to execute, therefore it can not be called in the background.
If you are running in foreground, then there is some other issue.
REgards,
RIch Heilman