‎2007 Apr 05 2:42 PM
Hi all,
i am having a flat file with tab space between the fields,
when i am uploading data using Gui_upload to an internal table its coming with some special characters like # etc...
so can any body plz help in this.....
Balu.
‎2007 Apr 05 2:45 PM
Hi..
In the FM 'GUI_UPLOAD', there is one option...
<b>HAS_FIELD_SEPARATOR = 'X'</b>
If ur text file is having seperators..u will get '#' s.
so with the above stmt. in that FM, passing 'X' will tell that file is havin separators..
Ram.
‎2007 Apr 05 2:46 PM
Hi
In GUI_UPLOAD there will be an option to put delimeters. Put any delimiter then the data will correctly come without any special characters.
Regards
Haritha.
‎2007 Apr 05 2:46 PM
Hi Bala,
Have you used the filetype as DAT??
Also chk this info for datatype DAT
'DAT'
he components of the internal table are filled from the file. If the
able contains more than one column, the entries in the file must be
eparated by tabs. Conversion exits are not carried out.
or the different data types, the following applies:
- 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 formatted according to the date format defined in
the
user settings.
- T
The time must have format hh:mm:ss.
Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Apr 05 2:46 PM
Hi,
Are you using Tab delimited Text file that is converted from EXCEL?
Once it is tab delimited text file, check for any unwanted characters using find/replace and remove.
On which version of SAP are you working?
check..whether any Unicode related problem?
regards,
Anji
‎2007 Apr 05 2:48 PM
Hi,
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
has_field_seperater = 'x'
TABLES
DATA_TAB = XTAB.
‎2007 Apr 05 2:48 PM
Hi Bala,
Please try this.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\test.txt'
filetype = 'ASC'
has_field_separator = 'X'
tables
data_tab = itab.
Thanks&Regards,
Siri.
‎2007 Apr 05 2:50 PM
Hi,
When uploading in gui_upload u need to give <b>HAS_FIELD_SEPARATOR</b>
as 'X'.
Regards,
ananth
‎2007 Apr 05 2:53 PM
Hi Bala,
Your file is tab dilimited. If you still have problem go through the code below:
CONSTANTS: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'ASC'
has_field_separator = c_tab
TABLES
data_tab = itab_upload
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.
reward is useful,
regards,
Tanmay
‎2007 Apr 05 3:34 PM
Hi Bala,
For this function module you have to pass the file name of the string datatype.
Please check it first. And also check the file type should be of DAT.
Here i am giving the example of a file name.
Parameters:p_fname like rlgrap-filename.
And before calling the function module.
data:p_fname1 type string.
p_fname1 = p_fname.
Hope it will solve your problem.
Reward if helpful.
Regards,
Ramana