Skip to Content

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

UPLOAD MORE than one file into 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Ă­

Tags:
Former Member
Former Member replied

Data:LV_FILES TYPE FILETABLE,

LV_RC TYPE I,

I_DIR TYPE STRING,

IT_TEXTO TYPE STANDARD TABLE OF S_TEXTO ,

TMP_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:
'

MULTISELECTION = 'X'

CHANGING

FILE_TABLE = LV_FILES

RC = LV_RC.

CLEAR :IT_TEXTO[].

LOOP AT LV_FILES INTO I_DIR.

CLEAR TMP_TEXTO[].

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

EXPORTING

FILENAME = I_DIR

READ_BY_LINE = 'X' " FILETYPE = 'ASC'

CHANGING

DATA_TAB =TMP_TEXTO

APPEND LINES OF TMP_TEXTO TO IT_TEXTO.

ENDLOOP.

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