Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FILES. Download to internal table

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Ă­

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question