Use the following code
x_fext = 'TXT
CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = c_title default_extension = c_fext default_filename = 'file.txt' * FILE_FILTER = initial_directory = 'c:' multiselection = abap_false * WITH_ENCODING = CHANGING file_table = li_file rc = sy-subrc * USER_ACTION = * FILE_ENCODING = EXCEPTIONS file_open_dialog_failed = 1 cntl_error = 2 error_no_gui = 3 not_supported_by_gui = 4 OTHERS = 5
Runtime errors MESSAGE_TYPE_X Occurred on 22.03.2006 at 12:04:25 The current application triggered a termination with a short dump. What happened? The current application program detected a situation which really should not occur. Therefore, a termination with a short dump was triggered on purpose by the key word MESSAGE (type X). What can you do? Print out the error message (using the "Print" function) and make a note of the actions and input that caused the error. To resolve the problem, contact your SAP system administrator. You can use transaction ST22 (ABAP Dump Analysis) to view and administer termination messages, especially those beyond their normal deletion date. Error analysis Short text of error message: Error number 1 receiving the results of an OLE call Technical information about the message: Diagnosis The system could not assign the results of an OLE Automation call t Meanings of the error number " " o -1: The event memory of the automation queue is destroyed - int o 1: There is no valid link to the program variables (PcbInvalid o 2: The link cannot be expanded (PcbInternal) o 3: The link points to an internal table that has been cleared o 4: The link points to a local variable whose stack frame has be Note: Errors 3 and 4 indicate a programming error. When you program the return value (for example, the selected node of a tree) is not reasons, control calls are not necessarily sent to the front end im instead. The queue may be sent to the frontend at a point where the for example, the call occurred in a subroutine that had ended by th control calls with local importing parameters.