Application Development 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: 

how to upload .csv file from presentation server to internal table?

Former Member
0 Kudos

Hi All,

how to upload .csv file from presentation server to internal table?

thanks,

Anil.

4 REPLIES 4

Former Member
0 Kudos

use FM gui_upload

specify the name of the internal table and the file name.

You can code like this;

TYPES: BEGIN OF x_file2,

data(400), "data

END OF x_file2.

&----


  • I N T E R N A L T A B L E D E C L A R A T I O N S *

&----


DATA: it_file TYPE STANDARD TABLE OF x_file2 WITH HEADER LINE." File Data

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = l_file

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = it_file2

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.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

regards,

srinivas

<b>*reward for useful answers*</b>

Former Member
0 Kudos

Hi,

You can upload data from presentation server to an internal table using gui_upload fm.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\test.csv'

FILETYPE = 'ASC'

TABLES

DATA_TAB = itab

EXCEPTIONS....

Regards,

Alexandros.

Former Member
0 Kudos

hi,

irrespective of the type of file.All files can be uploade from presentation server

to internal table using function module GUI_UPLOAD.

Regards

srinivas

varma_narayana
Active Contributor
0 Kudos

hi...

Use the FM

GUI_UPLOAD

or

KCD_CSV_FILE_TO_INTERN_CONVERT

<b>Reward if Helpful.</b>