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 from desktop

Former Member
0 Likes
1,097

Hi all

i have to upload multiple files from desktop. can anyone suggest the procedur to do this.

Is there any function module in sap to upload multiple files from desktop. Or there is some other way to upload multiple files from desktop.

Thanks in advance

anu

9 REPLIES 9
Read only

Former Member
0 Likes
1,066

You can write your own logic to construct filename (You will also have to rename filenames in your directory) and then LOOP it to upload using GUI_UPLOAD.

Read only

Former Member
0 Likes
1,066

Hi Anu

What is the format of files you want to upload?

Regards

Ashish

Read only

0 Likes
1,065

Hi

the format is tab delimited...and if possible plz can u send me some code if ther are multiplt files to be upload from desktop....

thanks

Read only

0 Likes
1,065

Hi,

I suppose that this code could be useful for you.

data: wa_file type string.

data: tab_file like table of wa_file,

pcount type i.

field-symbols <tab> type standard table.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

exporting

DIRECTORY = 'C:\test'

FILTER = '.'

FILES_ONLY = 'X'

  • DIRECTORIES_ONLY

changing

FILE_TABLE = tab_file

count = pcount.

ASSIGN ('internal_table') TO <tab>.

loop at tab_file into wa_file.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

exporting

FILENAME = wa_file

changing

data_tab = <tab>.

endloop.

Svetlin

P.S. If you find an answer useful, please assign reward points.

Message was edited by: Svetlin Rusev

Read only

0 Likes
1,065

HI,

try with this code

data :itab1 like mara occurs 0 with header line.

data : begin of ist,

fname type string,

end of ist.

data : itab2 like ist occurs 0 with header line.

itab2-fname = 'c:\text111.txt'.

append itab2.

itab2-fname = 'c:\text112.txt'.

append itab2.

itab2-fname = 'c:\text113.txt'.

append itab2.

loop at itab2.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = itab2-fname

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = '#'

tables

data_tab = itab1.

endloop.

Read only

0 Likes
1,065

HI svetlin..

can u plz elaborate a code little bit. I am not able to run the program if i am using the code..ASSIGN ('internal_table') TO <tab>. in this which interan table u means i have to assign...

can u plz help on this...

thanks

Read only

Former Member
0 Likes
1,065

Hi,

You collect all the file names into the internal table , and in the loop you call the GUI_UPLOAD FM.

I don't thing any single function module doing this job.

Cheers,

Sasi

Read only

Former Member
0 Likes
1,065

Hi,

Use the following static methods:

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES - to get your files names

CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD - to upload your files into internal tables

Svetlin

Read only

Former Member
0 Likes
1,065

Hi all,

i am facing problem in uploading mutiple files together from desktop.

please can someone send me the code for that. i am not able to upload multiple files together..

plz help in this object

thanks