10-22-2007 12:18 PM
Hi.
I was trying to upload data in a tab-delimited textfile.
I could do it for a ASC textfile (by setting FILETYPE = 'ASC'), but I couldn't do it for a tab-delimited textfile (by setting FILETYPE = 'DAT').
Any help is appreciated.
10-22-2007 12:59 PM
Hello Kian
With respect to <b>Unicode </b>you should no longer use function modules for GUI upload/download but replace this by the corresponding methods GUI_UPLOAD and GUI_DOWNLOAD of class <b>CL_GUI_FRONTEND_SERVICES</b>.
Like already said method GUI_UPLOAD has a parameter HAS_FIELD_SEPARATOR where 'X' means "<i>Columns Separated by Tabs in Case of ASCII Upload</i>".
Regards
Uwe
10-22-2007 12:22 PM
Hi,
For the DAT type file. You have to mentioned the HAS_FIELD_SEPARATOR parameter then only it will work it is mandatory for DAT file type.
set HAS_FIELD_SEPARATOR = X'
<b><REMOVED BY MODERATOR></b>
Thanks,
Muthu.
Message was edited by:
Muthu Prabakaran Selvam
Message was edited by:
Alvaro Tejada Galindo
10-22-2007 1:31 PM
Hi Muthu,
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = X'
generated an error "Wrong value of the parameter filetype".
When I changed FILETYPE to 'ASC', I have many '#' when I save the records to database.
null
10-22-2007 12:25 PM
You may use file separater importing parameter and file type as ASCI.
10-22-2007 12:41 PM
hi kian,
If u r using DAT file then HAS_FIELD_SEPERATOR should contain X.
<b>check the following code:</b>
parameters: p_file like rlgrap-filename. " File Name.
call function 'GUI_UPLOAD'
exporting
filename = p_file " NAME of the file
<b> filetype = 'DAT'
has_field_separator = 'X '</b> " <b>X indicates Fields are separated by tabs.</b>
tables
data_tab = t_file " Internal table that contains the file data
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.
<b>IF the file type is DAT then following rules applies.</b>
The components of the internal table are filled from the file. If the
table contains several columns, the entries in the file must be
separated by tabs. No conversion exits are carried out.
The following applies for the different data types:
- I or N or P or F
The numbers must be formatted according to the decimal representation
defined in the user settings.
- D
The date must be defined according to the date format defined in the
user settings.
- T
The time must have the format hh:mm:ss.
Reward me if useful...
Harimanjesh AN
10-22-2007 12:59 PM
Hello Kian
With respect to <b>Unicode </b>you should no longer use function modules for GUI upload/download but replace this by the corresponding methods GUI_UPLOAD and GUI_DOWNLOAD of class <b>CL_GUI_FRONTEND_SERVICES</b>.
Like already said method GUI_UPLOAD has a parameter HAS_FIELD_SEPARATOR where 'X' means "<i>Columns Separated by Tabs in Case of ASCII Upload</i>".
Regards
Uwe
10-22-2007 1:34 PM
Hi Uwe,
when i set
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
I got an error message ''Wrong value of the parameter filetype".
When I changed FILETYPE = 'ASC',
My DB records become errorneous with many # in the fields of the records.
10-22-2007 1:41 PM
Hi Kian
now try with some other set of data
i mean to say when uploading data use some other data (not same as before )
10-22-2007 1:52 PM