此实例将演示用CL_GUI_FRONTEND_SERVICES下的静态方法FILE_OPEN_DIALOG打开多个文件后打印出打开文件的名称。具体程式如下。 DATAFILE_TABLETYPEFILE_TABLE."引用FILE_TABLE对象 *SELECT-OPTIONS:i_file FOR FILE_TABLE NO INTERVALS. DATA: lt_file_namesTYPEFILETABLE, lwa_file_nameLIKELINEOFlt_file_names, lv_...
DATA FILE_TABLE TYPE FILE_TABLE. 此实例将演示用CL_GUI_FRONTEND_SERVICES下的静态方法FILE_OPEN_DIALOG打开多个文件后打印出打开文件的名称。具体程式如下。 DATAFILE_TABLETYPEFILE_TABLE."引用FILE_TABLE对象 *SELECT-OPTIONS:i_file FOR FILE_TABLE NO INTERVALS. DATA: lt_file_namesTYPEFILETABLE, lwa_file_...
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_file. DATA: files TYPE filetable, h_files TYPE file_table, rc LIKE sy-subrc. CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = '下载到本地文件' default_extension = 'XLS' default_file_name = '默认文件名称' file_f...
destination=lv_destIMPORTINGrc=l_rcCHANGINGtemp=lv_dest.ENDCASE.ATSELECTION-SCREENONVALUE-REQUESTFORp_file."两种方式 F4_FILENAME 或者 cl_gui_frontend_services=>file_open_dialog"通过file_open_dialog有更多的个性化参数*CALL FUNCTION 'F4_FILENAME'*IMPORTING*file_name = p_file. "返回文件名DATA:lt_...
使用ABAP的OPEN DATASET带FOR OUTPUT语句打开文件; 使用TRANSFER语句写入文件; 使用CLOSE DATASET关闭文件(保存)。 DATA: gdf_filepath type dxfile-filename DATA: gdt_data type table of gts_data. DATA: ldf_length type i. FIELD-SYMBOLS: <lfs_outfile> TYPE gts_data ...
* FILE_OPEN_DIALOG_FAILED = 1 * CNTL_ERROR = 2 * ERROR_NO_GUI = 3 * NOT_SUPPORTED_BY_GUI = 4 * others = 5 . 如图 接口CL_GUI_FRONTEND_SERVICES 的其他几个常用方法: CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST EXPORTING
CLEAR: l_extension,l_filename,l_filter. ENDCASE. * Display save dialog window CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING default_extension = l_extension default_filename = l_filename file_filter = l_filter multiselection = ' ' ...
file_name = s_file EXCEPTIONS MASK_TOO_LONG = 1 OTHERS = 2. 使用Class cl_gui_frontend_services的静态方法file_open_dialog 此方法功能强大,可以修饰文件选择框,指定默认选择路径,设置文件类型过滤,同时打开多个文件,返回用户操作等(打开系统已存在的文件) ...
DATA: WA_FILE_TABLE LIKE LINE OF LT_FILE_TABLE. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG EXPORTING WINDOW_TITLE = '打开文件' CHANGING FILE_TABLE = LT_FILE_TABLE RC = LV_RC. IF SY-SUBRC = 0. READ TABLE LT_FILE_TABLE INTO WA_FILE_TABLE INDEX 1. P_FILE = WA_FILE_...
5、EXPORTINGwindow_title=' 选择文件 'default_extension='*'CHANGINGfile_table=lt_filetablerc=lv_rcEXCEPTIONSfile_open_dialog_failed=1cntl_error=2error_no_gui=3not_supported_by_gui=4OTHERS=9.IFlt_filetableISINITIAL .EXIT.ENDIF.READ TABLE lt_filetableINDEX1.3/14* 解析路径文件PERFORMfrm_split_...