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

Upload text file to

Former Member
0 Likes
720

Hello,

I want to upload data in a text file to an internal table. Can any one tell me what FM i can use for this(other than WS* FMs)? and what params i need to pass.

Thank you,

Sharan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
683

Hi Sharan,

Use gui_upload.

For Sample Programs Check this :

<a href="http://www.sapdevelopment.co.uk/file/file_uptabpc.htm">http://www.sapdevelopment.co.uk/file/file_uptabpc.htm</a>

<a href="http://www.iconet-ltd.co.uk/sample_entry.php?id=28">http://www.iconet-ltd.co.uk/sample_entry.php?id=28</a>

Regards,

Raghav

Hello,

I want to upload data in a text file to an internal table. Can any one tell me what FM i can use for this(other than WS* FMs)? and what params i need to pass.

Thank you,

Sharan

3 REPLIES 3
Read only

Former Member
0 Likes
684

Hi Sharan,

Use gui_upload.

For Sample Programs Check this :

<a href="http://www.sapdevelopment.co.uk/file/file_uptabpc.htm">http://www.sapdevelopment.co.uk/file/file_uptabpc.htm</a>

<a href="http://www.iconet-ltd.co.uk/sample_entry.php?id=28">http://www.iconet-ltd.co.uk/sample_entry.php?id=28</a>

Regards,

Raghav

Read only

Former Member
0 Likes
683

you can use GUI_UPLOAD.

you need to pass the file name, file type and the table which will hold the uploaded data.

Regards,

ravi

Read only

Former Member
0 Likes
683

Sharan,

for tab limited files..

DATA : lv_filename TYPE string.

  • UPload Local excel file

  • Upload Production Version file

CLEAR lv_filename.

lv_filename = p_file1.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lv_filename

filetype = 'ASC'

has_field_separator = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

dat_mode = 'X'

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

data_tab = it_master

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17

.

-Anu