先将文件通过cl_gui_frontend_services=>gui_upload以BIN的文件类型上载,然后通过cl_abap_zip中的方法add() save()压缩,最后下载到本地。 REPORTztest_zip.TYPES:BEGINOFbin_file, nameTYPEstring, sizeTYPEi, dataTYPEsolix_tab,ENDOFbin_file .DATA: lv_filenameTYPEstring, wa_bindataTYPEbin_file, it_bi...
lv_zip_xstring=oref_zip->save(). CALL FUNCTION'SCMS_XSTRING_TO_BINARY' EXPORTING buffer=lv_zip_xstring IMPORTING output_length=v_zip_size TABLES binary_tab=it_zip_bin_data. cl_gui_frontend_services=>file_save_dialog( EXPORTING window_title='SELECT THE LOCATION TO SAVE THE FILE' file_f...
it_bindata TYPE STANDARD TABLE OF bin_file , oref_zip TYPE REF TO cl_abap_zip , lv_zip_xstring TYPE xstring , lv_xstring TYPE xstring , lv_path TYPE string , it_filetab TYPE filetable , ret_code TYPE i , v_usr TYPE i , v_zip_size TYPE i , it_zip_bin_data TYPE STANDAR...
...(构造XML)lr_ostream=lr_ixml->create_stream_factory()->create_ostream_xstring(string=lv_xstring)lr_ixml->create_renderer(ostream=lr_ostreamdocument=lr_document)->render().2 或者直接使用FM将内表转换成XSTRINGDATA:izipTYPEREFTOcl_abap_zip, contTYPExstring...*DO10000TIMES.*APPEND'...
DATA: ZIP_TOOL TYPE REF TO CL_ABAP_ZIP, FILENAME TYPE STRING VALUE 'g:\binfile.pdf', " Source File NAme FILENAME_ZIP TYPE STRING VALUE 'g:\zipfile.zip'. " Zip File DATA: T_DATA_TAB TYPE TABLE OF X255, BIN_SIZE TYPE I, BUFFER_X TYPE XSTRING, ...
SAP提供了一个类CL_ABAP_ZIP来创建.zip扩展名的压缩文件。 代码: 先将文件通过cl_gui_frontend_services=>gui_upload以BIN的文件类型上载,然后通过cl_abap_zip中的方法add() save()压缩,最后下载到本地。 REPORT ztest_zip. TYPES: BEGIN OF bin_file, name TYPE string, size TYPE i, data TYPE solix_...
CL_ABAP_ZIP 创建压缩文件_SAP刘梦 闲看的时候发现一个好玩儿的demo,生成压缩文件的。 效果 代码 TYPES : BEGIN OF bin_file , name TYPE string , size TYPE i , data TYPE solix_tab , END OF bin_file . DATA : lv_filename TYPE string ,...
oref_zip TYPE REF TO cl_abap_zip, lv_zip_xstring TYPE xstring, lv_xstring TYPE xstring, lv_path TYPE string, it_filetab TYPE filetable, ret_code TYPE i, v_usr TYPE i, v_zip_size TYPE i, it_zip_bin_data TYPE STANDARD TABLE OF raw255, v_dest_filepath TYPE string. ...
oref_zip TYPE REF TO cl_abap_zip, lv_zip_xstring TYPE xstring, lv_xstring TYPE xstring, lv_path TYPE string, it_filetab TYPE filetable, ret_code TYPE i, v_usr TYPE i, v_zip_size TYPE i, it_zip_bin_data TYPE STANDARD TABLE OF raw255, v_dest_filepath TYPE string. ...