FILE_OPEN_DIALOG

This method opens a file open dialog on the client PC that allows the user to select files. The file open dialog only provides an interface for selecting files. No operation is directly associated with selecting files in the dialog. What is to be done with the files whose names are transferred to the server, is up to the application that opened the file dialog.

The dialog displayed is an operating system dialog and is therefore not scriptable. In order to guarantee scriptability, please use the function module GUI_FILE_LOAD_DIALOG instead of calling CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG directly if multi-selection is not required.

Arguments

[IMPORTING] window_title TYPE STRING

Title to be displayed on dialog. This is an optional parameter.

[IMPORTING] default_extension TYPE STRING

The default extension is the extension that should be selected initially when die file dialog is displayed. Unlike in the filter string the default extension is specified without "*." at the beginning. With other words, only the characters of the extension itself are specified here.

This parameter is optional.

[IMPORTING] default_filename TYPE STRING

Name of file to be initially displayed. The file name specified here will also be displayed if no file with that name exists in the initial directory.

This is an optional parameter.

[IMPORTING] file_filter TYPE STRING

String containing list of file filters. For further information on the format of the file filter string please see note 991104.

This parameter is optional.

[IMPORTING] with_encoding TYPE ABAP_BOOL

Flag indicating whether an additional field should be displayed in the file dialog which allows the selection of an encoding in which the selected files have been stored.

This parameter is optional.

[IMPORTING] initial_directory TYPE STRING

Directory to be displayed initially when the file dialog is displayed.

This is an optional parameter.

[IMPORTING] multiselection TYPE ABAP_BOOL

Indicates whether the selection of multiple files in the file dialog should be allowed or not.

Specifying a value for this parameter is optional.

[CHANGING] file_table TYPE FILETABLE

Table that receives the list of names of files that have been selected by the user.

[CHANGING] rc TYPE I

Return code.

Possible values:

  • -1

    the method failed

  • 0

    the user canceled selection of file(s)

  • >0

    the user selected one or more files. In this case the number is equal to the number of files selected.

[CHANGING] user_action TYPE I

Action the user took, i.e. whether he selected files or aborted the action.

The parameter is optional.

Possible values:

  • ACTION_OK

    the user selected files

  • ACTION_CANCEL

    the user aborted the selection of files

[CHANGING] file_encoding TYPE ABAP_ENCODING

Encoding of files selected. Optional parameter.

Exceptions

CNTL_ERROR

This exception is raised if calling one of the required front end methods fails.

ERROR_NO_GUI

Currently not used.

FILE_OPEN_DIALOG_FAILED

Fired if file open dialog could not be opened.

NOT_SUPPORTED_BY_GUI

Thrown if neither Windows nor Java nor Web GUI is being used.