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 Multiple Files from a folder at a single go?

Former Member
0 Kudos

Hi friends,

My requriment is to Upload many txt or excel files in a single shot.

If its a single file i can upload through Ws_upload or Gui_upload.

in the same way is there any function modules to upload many files at a time.

Regards

Venkatesh.S

1 REPLY 1

Former Member
0 Kudos

Hi Venkatesh,

Try this code..

data: l_filename type string OCCURS 0 WITH HEADER LINE.

l_filename = 'c:\temp1.xls'.

APPEND L_FILENAME

l_filename = 'c:\temp2.xls'.

APPEND L_FILENAME

LOOP AT L_FILENAME

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = l_filename

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = '#'

TABLES

DATA_TAB = itab1.

OPEN DATASET <applicationfilename> FOR OUTPUT IN TEXT MODE.

IF sy-subrc = 0.

LOOP AT ITAB1

TRANSFER ITAB1 TO pt_infil .

ENDLOOP.

ENDIF.

CLOSE DATASET pt_infil.

ENDLOOP.

OR

use CL_GUI_FRONTEND_SERVICES->DIRECTORY_LIST_FILES

Regards,

Goutham.