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

query

Former Member
0 Likes
272

hi guyz,

can anybody plz tell me how to upload data in my c drive into sap database table.

this is a zipcode file.

I created a database table in se11.

i need it asap.

plz help me

thanks in advance

sudheer

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
245

Well the easiest way is to write a quick program which uploads the data to an internal table, then you can fill the database table . A short program may look like this, here ZTABLE is your custom table and it is assumed that the file is comma delimited. I find it easier to work with this way.



report zrich_0001.

data: istr_tab type table of string with header line.
data: xztable type ztable.

call function 'GUI_UPLOAD'
     exporting
          filename = 'c:ztable.txt'
     tables
          data_tab = istr_tab.


loop at istr_tab.
  split istr_tab at ',' into xztable-fld1 xztable-fld2 xztable-fld3.
  insert ztable from xztable.
endloop.

Regards,

Rich Heilman

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
246

Well the easiest way is to write a quick program which uploads the data to an internal table, then you can fill the database table . A short program may look like this, here ZTABLE is your custom table and it is assumed that the file is comma delimited. I find it easier to work with this way.



report zrich_0001.

data: istr_tab type table of string with header line.
data: xztable type ztable.

call function 'GUI_UPLOAD'
     exporting
          filename = 'c:ztable.txt'
     tables
          data_tab = istr_tab.


loop at istr_tab.
  split istr_tab at ',' into xztable-fld1 xztable-fld2 xztable-fld3.
  insert ztable from xztable.
endloop.

Regards,

Rich Heilman