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: 

Select several files in open dialog.

Former Member
0 Kudos

Hi,

In a program, I used one input file selected by this function 'AL_POPUP_FOR_LOCAL_PATH' (open dialog) but now, I must several files same times.

I used the input file for splitting in three files in output. Now, I must to split several files always in three files in output.

The way is same for this two process or for several files, it's necessary to proced of another way?

Tanks.

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

Hi Xavier Couloumies,

Try below code...

Execute

Press F4 for the text box...

then select multiple files by pressing control button...

OPEN

then See the button with ==> near to the textbox which is for multiple selection... press it and u can see all selected files there... now u can use it as per your logic...

TABLES: FILE_TABLE.

DATA: LT_FILE_NAMES TYPE FILETABLE,
      LWA_FILE_NAME TYPE FILE_TABLE,
      LV_SUBRC TYPE I.


SELECT-OPTIONS: MUL_FILE FOR FILE_TABLE NO INTERVALS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR MUL_FILE-LOW.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
      INITIAL_DIRECTORY       = 'C:Temp'
      MULTISELECTION          = 'X'
    CHANGING
      FILE_TABLE              = LT_FILE_NAMES[]
      RC                      = LV_SUBRC
*    USER_ACTION             =
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      OTHERS                  = 4.
  IF SY-SUBRC  <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  MUL_FILE-SIGN = 'I'.
  MUL_FILE-OPTION = 'EQ'.

  LOOP AT LT_FILE_NAMES INTO LWA_FILE_NAME.
    MUL_FILE-LOW = LWA_FILE_NAME.
    APPEND MUL_FILE.
  ENDLOOP.

START-OF-SELECTION.
  LOOP AT MUL_FILE.
    WRITE: / MUL_FILE-LOW.
  ENDLOOP.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

2 REPLIES 2

Former Member
0 Kudos

Hi,

This is for the presentation server

CL_GUI_FRONTEND_SERVICES->FILE_OPEN_DIALOG

here we can have mutliple files for selection this can be done by the MULTISELECTIOn paramter in this method and also we have to populate the FILETABLE in that method.

pls check this link-

Pls elaborate your requirement.

Regards

Lekha

former_member387317
Active Contributor
0 Kudos

Hi Xavier Couloumies,

Try below code...

Execute

Press F4 for the text box...

then select multiple files by pressing control button...

OPEN

then See the button with ==> near to the textbox which is for multiple selection... press it and u can see all selected files there... now u can use it as per your logic...

TABLES: FILE_TABLE.

DATA: LT_FILE_NAMES TYPE FILETABLE,
      LWA_FILE_NAME TYPE FILE_TABLE,
      LV_SUBRC TYPE I.


SELECT-OPTIONS: MUL_FILE FOR FILE_TABLE NO INTERVALS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR MUL_FILE-LOW.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
      INITIAL_DIRECTORY       = 'C:Temp'
      MULTISELECTION          = 'X'
    CHANGING
      FILE_TABLE              = LT_FILE_NAMES[]
      RC                      = LV_SUBRC
*    USER_ACTION             =
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      OTHERS                  = 4.
  IF SY-SUBRC  <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  MUL_FILE-SIGN = 'I'.
  MUL_FILE-OPTION = 'EQ'.

  LOOP AT LT_FILE_NAMES INTO LWA_FILE_NAME.
    MUL_FILE-LOW = LWA_FILE_NAME.
    APPEND MUL_FILE.
  ENDLOOP.

START-OF-SELECTION.
  LOOP AT MUL_FILE.
    WRITE: / MUL_FILE-LOW.
  ENDLOOP.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7