‎2008 Oct 23 3:43 PM
Hi ,
Can any one let me know how to upload data from CSV file.
thnks
abdul.
‎2008 Oct 23 3:44 PM
search before, if you know the way to upload data for another file, it will be the same. check the way youc an upload any other file, and see what you can do there to upload csv file
‎2008 Oct 23 10:29 PM
Hi
Maybe u can use the FM GUI_UPLOAD
Search others forums if u need more help
Regards
Gregory
‎2008 Oct 24 12:00 AM
You could use the function GUI_UPLOAD to fill a table with only one field like a line. Then use SPLIT to pass the data to other table, like that:
DATA: BEGIN OF t_line OCCURS 0,
line(200),
END OF t_line.
call function 'GUI_UPLOAD'
exporting
filename = p_path
filetype = 'ASC'
tables
data_tab = t_line[].
LOOP AT t_line.
SPLIT t_line-line AT ','
INTO field1,
field2,
...,
fieldn.
ENDLOOP.
‎2008 Oct 24 12:01 AM
Hi!
Try this code, I used it in a program
PARAMETERS:
PATHFILE(128) OBLIGATORY DEFAULT 'C:\vendors.csv'.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = pathfile
TABLES
DATA_TAB = i_reg
EXCEPTIONS
OTHERS = 1.
vendors.cvs ---> Is .xls file (excel)
I hope this help you.
Regards