06-27-2008 5:57 AM
Hello,
I am using the function module GUI_UPLOAD as follows
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = str_file
filetype = 'ASC'
has_field_separator = '|'
TABLES
data_tab = it_upload.
The file is having the data as follows
0000001000083|0000010000029|200804|20080401|20080430|000000002857113.86|Z15|000000002857113.86
and the internal table is it_upload is as follows.
DATA:BEGIN OF it_upload OCCURS 0,
cn_no(13), " type RECNNUMBER,
cust_temp(13), " Customer number
Period_temp(6), " Period
report_from(8),
report_to(8),
net_sales TYPE resrsalesnet,
salestype(3),
sales_temp TYPE resrsalesnet,
END OF it_upload.
Here the problem is i am not getting the data into the fields appropriately.
Please suggest me where i had done mistake and it is urgent
Regards,
Radha.
06-27-2008 5:59 AM
In the field seperator parameter you gave '/' as the seperator.
But GUI_UPLOAD is only useful for tab delimiters.
'X': Fields are separated by tabs.
SPACE: Fields are not separated by tabs. In this case, the table must
contain either only one single column or all columns must be contained
in the file in their full length.
I suggest you to read the documentation provided in the function module.
Regards,
Jagadish
06-27-2008 6:01 AM
I would suggest you better use Excel file for uploading.Make use of FM ALSM_EXCEL_TO_INTERNAL_TABLE.
06-27-2008 6:02 AM
No i cant change the input file at all and please suggest other function modules where i can use the '|' as field seperator
06-27-2008 6:08 AM
Hi,
If you are using a text file to uplaod these values, use one TAB space between the values . i.e after each value press TAB and then enter the next value.
It is advised to use excel format to upload , as data is copied as it is in the excel sheet.
reward points if you find it useful.
Ajith
06-27-2008 6:19 AM
06-27-2008 6:43 AM
Change the code and see...
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = str_file
filetype = 'ASC'
has_field_separator = 'X'
"not '|'
TABLES
data_tab = it_upload.
06-27-2008 6:49 AM
Hi
What you do is:
data: begin of itab occurs 0,
data(255) type c,
end of itab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = str_file
filetype = 'ASC'
TABLES
data_tab = itab.
loop at itab.
split itab-data at '|' into it_upload-cn_no
it_upload-cust_temp
it_upload-Period_temp
it_upload-report_from
it_upload-report_to
it_upload-net_sales
it_upload-salestype
it_upload-sales_temp .
append it_upload.
endloop.
Regards
Gareth
Edited by: Gareth Ellem on Jun 27, 2008 3:49 PM
06-27-2008 6:50 AM
hi ,
u r having word file right. first convert that into excel . then give file name and save as type " tab delimited " .then save . automatically note pad of the given file name will come. then use that file in ur program with file type 'DAT'.
every thing will be assigned properly.
regards,
diana.
06-27-2008 7:07 AM
Hi Radha,
In the HAS-FIELD_SEPERATOR option we can have only two options. It is either 'X' or ' '.
'X' implies - It has field seperator
' ' implies - No field seperator.
Hope this helps you.
Regards,
Chandra Sekhar
06-27-2008 7:09 AM