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: 

FILES. Download to internal table

Former Member
0 Kudos

Data:LV_FILES TYPE FILETABLE,

LV_RC TYPE I,

I_DIR TYPE STRING,

IT_TEXTO TYPE STANDARD TABLE OF S_TEXTO ,

WA_TEXTO LIKE LINE OF IT_TEXTO.

"Open a dialog

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      INITIAL_DIRECTORY = 'C:'
    CHANGING
      FILE_TABLE        = LV_FILES
      RC                = LV_RC.

READ TABLE LV_FILES INDEX 1 INTO I_DIR.
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
      FILENAME        = I_DIR
      READ_BY_LINE    = 'X'     " FILETYPE = 'ASC'
    CHANGING
      DATA_TAB        = IT_TEXTO

With this code I open a dialog and then I choose a file to upload to Internal table.

But I only can choose one.

Who can I do to change my code and I choose three or four files and then download to internal table.

Thanks a lot

Message was edited by:

Ana Marí

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Ana

There are only minor changes necessary:

"Open a dialog

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      INITIAL_DIRECTORY = 'C:\'
      multiselection = 'X'   " !!!  " allow selection of multiple files
    CHANGING
      FILE_TABLE        = LV_FILES
      RC                = LV_RC.

  LOOP AT lv_files INTO i_dir.
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING...    
  ENDLOOP.

Regards

Uwe

1 REPLY 1

uwe_schieferstein
Active Contributor
0 Kudos

Hello Ana

There are only minor changes necessary:

"Open a dialog

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      INITIAL_DIRECTORY = 'C:\'
      multiselection = 'X'   " !!!  " allow selection of multiple files
    CHANGING
      FILE_TABLE        = LV_FILES
      RC                = LV_RC.

  LOOP AT lv_files INTO i_dir.
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING...    
  ENDLOOP.

Regards

Uwe