‎2008 Feb 28 11:38 AM
Hi all,
I am using Gui_Upload to upload a flat file as below.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_fname
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
tables
data_tab = i_final.
I am getting '###' in the internal table. I checked the file structure also. Pls help me.
Thanks,
Praveena
‎2008 Feb 28 11:41 AM
Hi,
Check if in ur flat-file two fields are seperated by one tab space.....
‎2008 Feb 28 11:42 AM
Hi
you specified
HAS_FIELD_SEPARATOR = 'X'
so save that file as tab delimited file then it will come in order
if you save that as normal file then it will display that ## symbols
‎2008 Feb 28 11:42 AM
Check your file data structure. Is it a tab-delimitted file?
IT_FINAL should have the same structure as that of the Input file data. Check that.
Check these and revert back.
Hope this helps.
Thanks,
Balaji
‎2008 Feb 28 11:42 AM
Hi,
Check out if u have given correct tab space in ur file.
Regards,
Ramya
‎2008 Feb 28 11:45 AM
hi
check the ur flat file values are tab milimeter format r not
and check the fm in types of export parameters
regards
kk .
‎2008 Feb 28 11:46 AM
Hi,
What is a delimiter u are using.
If tab is your delimiter use FILETYPE = 'DAT'
If delimiter is 'X' then replace it with ',' (comma) and try.
Regards,
Sreekanth
‎2008 Feb 28 11:49 AM
hi,
Does ur flat file contains data. When u use tab delimited flat file u will get details seperated by '#'.
Just run this program and see.ur internal table has that '#' symbol with data . In this i have used gui_download to download data into another flat file. (use tab delimited flat file)
REPORT zflatfile_upper_f4help.
*----
INTERNAL TABLE
*----
DATA: BEGIN OF wi_upp OCCURS 0,
text TYPE string,
END OF wi_upp.
DATA: BEGIN OF wi_upp1 OCCURS 0,
text1 TYPE string,
END OF wi_upp1.
*----
DATA
*----
DATA: var1 LIKE rlgrap-filename.
DATA: var2 LIKE rlgrap-filename.
DATA : name1 TYPE string ,
name2 TYPE string.
*&----
*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'
*&----
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
dynpro_number = syst-dynnr
CHANGING
file_name = var1.
IF sy-subrc <> 0.
ENDIF.
name1 = var1.
*&----
*& CALLING FUNCTIONAL MODULE 'GUI_UPLOAD'
*&----
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = name1
filetype = 'ASC'
TABLES
data_tab = wi_upp.
LOOP AT wi_upp.
WRITE:/ wi_upp-text.
TRANSLATE wi_upp-text TO UPPER CASE.
APPEND wi_upp TO wi_upp1.
WRITE:/ wi_upp-text.
ENDLOOP.
*&----
*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'
*&----
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
dynpro_number = syst-dynnr
CHANGING
file_name = var2.
name2 = var2.
*&----
*& CALLING FUNCTIONAL MODULE 'GUI_DOWNLOAD'
*&----
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = name2
filetype = 'ASC'
TABLES
data_tab = wi_upp1.
hope this helps u,
B.S.Arunsri
‎2008 Feb 28 12:21 PM
Hi all,
Thank u for ur answers... Am getting other error now. "Cannont interpret the data in the file".
ArunaSri I tried ur prg the file is uploading well and the result is also getting with one # seperator. Thank u for this.
With ur prg the file is working fine but in my prg am getting the error. Please help me..
Points will be rewarded,
Thanks in advance,
praveena
‎2008 Feb 28 11:50 AM
First thing, the structure of the flat file and the internal table must be same.
Check the data type of the fields for which you are getting an error.
Use .csv file or .txt file to upload the data.
I think this should do...
‎2008 Feb 28 11:52 AM
First thing, the structure of the flat file and the internal table must be same.
Check the data type of the fields for which you are getting an error.
Use .csv file or .txt file to upload the data.
I think this should do...
---
Reward points if helpful