Hi,
In my selection-screen program, I use method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG. It opens a pop-up screen to select a desired file, and puts the value into the parameter P_FILENM (char1024). After I select the file and close the pop-up screen, It takes about 2-3 seconds for the selection-screen parameter to refresh itself with the filename inside P_FILENM text-box. After execution, the program displays the file's contents in an SALV table. When I go back to the selection-screen using method GO_SALV_TABLE->CLOSE_SCREEN, it takes another 3-4 seconds during which the screen hangs, I can see the empty screen with the execution button but no parameters, and only then they appear and the screen becomes available.
My question is: why are those delays happening? Maybe it is related to the char1024 field? How can I prevent them from delaying the program's operation?
Thank you!
--------------------------------------------
SELECTION-SCREEN BEGIN OF LINE.
PARAMETER p_filenm TYPE zfilename. " Filename Upload textbox - ZFILENAME is based on CHAR1024
SELECTION-SCREEN END OF LINE.
--------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filenm.
PERFORM file_open_dialog CHANGING gv_file_name.
p_filenm = gv_file_name.
START-OF-SELECTION.
" get data
......
PERFORM setup_salv CHANGING gt_data[]
go_salv_table
go_salv_events
go_salv_events_handler
go_salv_display
go_salv_sorts
go_salv_columns
go_salv_column
go_salv_functions.
go_salv_table->display( ).
go_salv_table->close_screen( ).
--------------------------------------------
FORM file_open_dialog CHANGING ev_file_name TYPE zfilename.
DATA: lt_file_tab TYPE filetable,
ls_file LIKE LINE OF lt_file_tab[].
gv_report_title = text-001. " Choose a file
" Opening the File Selection dialog:
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = gv_report_title
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
file_filter = gc_filetypes_filter
* WITH_ENCODING =
* INITIAL_DIRECTORY =
* MULTISELECTION =
CHANGING
file_table = lt_file_tab[]
rc = gv_rc
* USER_ACTION =
* FILE_ENCODING =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
" Getting the selected file:
READ TABLE lt_file_tab[]
INTO ls_file INDEX 1.
" Setting the selected file as the parameter:
ev_file_name = ls_file-filename.
ENDFORM.