Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

csv file

Former Member
0 Likes
734

Hi ,

Can any one let me know how to upload data from CSV file.

thnks

abdul.

4 REPLIES 4
Read only

Former Member
0 Likes
710

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

Read only

Former Member
0 Likes
710

Hi

Maybe u can use the FM GUI_UPLOAD

Search others forums if u need more help

Regards

Gregory

Read only

0 Likes
710

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.


Read only

Former Member
0 Likes
710

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