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: 

upgradtion doubt in calling cl_gui_frontend_services=>file_open_dialog

Former Member
0 Kudos

hi,

Im upgrading from 4.5b to ecc 6.0 in the following code the export parameter Default extn parameter in the call method

cl_gui_frontend_services=>file_open_dialog does not get displayed

i,e *.xls should be there bydefault it is not there in 6.0 how to get it. check the code once

ws_filename get fm is in comments

CALL FUNCTION 'WS_FILENAME_GET'

  • EXPORTING

  • DEF_FILENAME = C_DEFFILE

  • DEF_PATH = L_LOCFILE

  • MASK = C_MASK

  • MODE = C_MODE

  • IMPORTING

  • FILENAME = L_FILE

  • EXCEPTIONS

  • INV_WINSYS = 1

  • NO_BATCH = 2

  • SELECTION_CANCEL = 3

  • SELECTION_ERROR = 4

  • OTHERS = 5.

  • IF SY-SUBRC EQ 3.

  • MESSAGE I999 WITH 'Action Cancelled by user'(044).

  • EXIT.

  • ENDIF.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

DEFAULT_EXTENSION = '*.xls,'

FILE_FILTER = '.'

CHANGING

file_table = W_FILENAME

rc = w_rc

EXCEPTIONS

FILE_OPEN_DIALOG_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

NOT_SUPPORTED_BY_GUI = 4

others = 5.

IF W_RC IS NOT INITIAL.

READ TABLE W_FILENAME INTO W_AREA INDEX 1.

IF SY-SUBRC = 0.

L_FILE = W_AREA-FILENAME.

ENDIF.

ENDIF.

1 REPLY 1

former_member182670
Contributor
0 Kudos

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = 'File Selection'
      default_filename        = '*.xls'
      file_filter             = '(*.xls)|*.XLS|'
    CHANGING
      file_table              = lt_filetable
      rc                      = lv_filecount
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.