‎2007 Feb 13 7:45 AM
Hie guys i have this scenario.I am downloading a file to a local server,but now i want a scenario whereby each time i run the program,the file should add to the existing file(append).For history sake ,at the end of the week i need a composite file which constitute all the daily runs.
please help with sample code. I am using the GUI_Download function .Add fro internal tables.
‎2007 Feb 13 7:47 AM
in GUI_DOWNLOAD FM there is an option APPEND , give that value as X
‎2007 Feb 13 7:47 AM
in GUI_DOWNLOAD FM there is an option APPEND , give that value as X
‎2007 Feb 13 8:17 AM
i am getting Exception condition "CONTROL_FLUSH_ERROR" raised.
Error analysis
A RAISE statement in the program "SAPLSFES " raised the exception
condition "CONTROL_FLUSH_ERROR".
Since the exception was not intercepted by a superior program
in the hierarchy, processing was terminated.
Short description of exception condition:
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
‎2007 Feb 13 8:27 AM
I am getting :Exception condition "CONTROL_FLUSH_ERROR" raised.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'C:\SAP\SD_INTERFACE.TXT'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = IT_FILE.
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2007 Feb 13 8:34 AM
Hi
U should use the EXCEPTIONS of GUI_DOWNLOAD to avoid the dump.
Anyway we can't know why that exception is raised, u haveing some problems on your frontend control, so perhaps some gui problem:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:SAPSD_INTERFACE.TXT'
TABLES
DATA_TAB = IT_FILE
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.Max
‎2007 Feb 13 8:37 AM
I guess the exception is raised because of APPEND .
How many records are there in your file each time you you run the program, I guess as the number of records are increased hugely it is giving that error
‎2007 Feb 13 8:38 AM
Hi,
Kindly follow the steps
1. Using GUI_UPLOAD, you first upload the downloaded file.
2.Then append your data to the same internal table to which you have just uploaded the file.
3. Then use GUI_DOWNLOAD with the same file name so that it will replace the existing one.
Validation: Make sure there is data into the internal table while downloading.Otherwise file will be gone..
Note: If ur prob solves,Kindly appreciate with points
Regards,
Rushikesh