2007 Feb 09 6:39 AM
Hi All,
I am getting problem in GUI_upload function module,
i am having one flat file and am taking the data from this flat file to one internal table using GUI_upload FM, the flat file is seperated by Tab.
after executing the program , if i try to print the internal table data then data is coming with "#" symbol,
how can i remove this,
Help me.
BALU.
2007 Feb 09 6:43 AM
- refers that the length might not be sufficient.
In debugging check whetehr the values are coming.
Refer this code
Retrieve data file from presentation server(Upload from PC)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.
2007 Feb 09 6:43 AM
- refers that the length might not be sufficient.
In debugging check whetehr the values are coming.
Refer this code
Retrieve data file from presentation server(Upload from PC)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.
2007 Feb 09 6:44 AM
HI,
Doesn't matter.
Read the contents into an internal table, and then use SPLIT stmt and store it into separate fields of another internal table.
Regards
Subramanian
2007 Feb 09 6:46 AM
try.
START-OF-SELECTION.
gd_file = p_infile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = gd_file
<b>has_field_separator = 'X' </b> "file is TAB delimited
TABLES
data_tab = it_record
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.
IF sy-subrc NE 0.
write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
skip.
endif.
2007 Feb 09 6:46 AM
Hi
I think # will come due to tab. in flat file replace tab with ',' you will get desired output.
Regards
Ravi Kanth
2007 Feb 09 6:55 AM
Hi,
You will have to check if the Internal table has the value Tab in your program and implement whatever logic you want to if you find it.
You can use the class CL_ABAP_CHAR_UTILITIES and the Attribute HORIZONTAL_TAB to check whether there is a Tab in your record.
regards,
Mahesh
2007 Feb 09 6:59 AM
hi
CONSTANTS: C_SPLIT TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB. this tell us to define the tab key .
sometimes we can use it . but to this question i think the up floor show us a good solution
2007 Feb 09 7:08 AM
just do this
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
has_field_separator = 'X'
********************************************
in your flat file use tab as separators