2009 Jan 19 12:01 PM
Hi Expert ,
I have the following code in my program:
Types : begin of ty_ascii,
data type string,
begin of ty_ascii.
Data : it_ascii type table of ty_ascii.
it_ascii contains may rows.. but if i want to use gui_downlaod : the fm makes in the file only 1 row
i call the fm like this:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = wa_filenaam
filetype = 'ASC'
TABLES
data_tab = it_ascii[]
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.
anybody some suggestions?
2009 Jan 19 12:45 PM
CRLF(2) type c.
CRLF = CL_ABAP_CHAR_UTILITIES=>CR_LF.
loop at it_ascii.
concatenate it_ascii-data CRLF into it_ascii-data .
modify it_ascii.
endloop.
Hi Expert ,
I have the following code in my program:
Types : begin of ty_ascii,
data type string,
begin of ty_ascii.
Data : it_ascii type table of ty_ascii.
it_ascii contains may rows.. but if i want to use gui_downlaod : the fm makes in the file only 1 row
i call the fm like this:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = wa_filenaam
filetype = 'ASC'
TABLES
data_tab = it_ascii[]
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.
anybody some suggestions?
2009 Jan 19 12:02 PM
Hello,
Can you share the code for populating it_ascii[] ?
BR,
Suhas
2009 Jan 19 12:07 PM
Hi...
check whether wa_filenaam is same type of filename exist in FM. it must be same. otherwise dump will occur.
Regards,
KP.
2009 Jan 19 12:08 PM
HI,
Please try this,
i am getting two records in this................
Types : begin of ty,
data type string,
end of ty.
Data : itab type table of ty.
data: wa type ty.
wa-data = 'adfasfafasd'.
append wa to itab.
clear: wa.
wa-data = 'adfasadfdfasdfafafasd'.
append wa to itab.
clear: wa.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'D:\new.txt'
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 = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
tables
data_tab = itab
FIELDNAMES =
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.
Regards.
Venkatesh.
2009 Jan 19 12:18 PM
Hi Venka,
I trying your code ..i get 1 row in the txt file
Im using a remote desktop connection but i don't think this is the problem.
2009 Jan 19 12:30 PM
Hi,
Make sure that wa_filenaam is of type string.
Suppose there are 2 rows in it_ascii[].
Is both the rows are coming in file but in single row?
In this case append some CR/LF character at the end of each row in it_ascii[].
And in FM give WRITE_LF = 'X'.
Hope it helps u.
2009 Jan 19 12:33 PM
wa_filenaam is of type string.
Suppose there are 2 rows in it_ascii[].
Yes both the rows are coming in file but in single row.
I also tried write_lf = 'X'
but stil it doenst help.
2009 Jan 19 12:36 PM
2009 Jan 19 12:40 PM
Can you please explain how to append CR/LF character at end of each row?
2009 Jan 19 12:45 PM
CRLF(2) type c.
CRLF = CL_ABAP_CHAR_UTILITIES=>CR_LF.
loop at it_ascii.
concatenate it_ascii-data CRLF into it_ascii-data .
modify it_ascii.
endloop.
2009 Jan 19 12:52 PM
2009 Oct 28 7:22 PM
Please, check the note 1008705.
I had the same problem and I solved installing a new patch for SAP GUI.
Regard,
Anderson.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |