- 浏览: 169266 次
- 性别:
- 来自: 成都
文章分类
REPORT ztest. DATA: gv_file_length TYPE i, gv_filehexcontent TYPE xstring, gv_zipfilehex TYPE xstring, gt_filebincontent TYPE solix_tab, gt_zipfilebin TYPE solix_tab, gv_zipfilename TYPE string, gv_folder TYPE string, go_zipper TYPE REF TO cl_abap_zip, gt_files TYPE TABLE OF char255 WITH HEADER LINE, gv_file TYPE string, gv_file_fullpath TYPE string, gv_results TYPE match_result_tab, gv_result TYPE match_result , gv_folder_name TYPE string, gv_lines TYPE i, gv_no_files TYPE i. *--------------------------------------------------------------------* * START-OF-SELECTION *--------------------------------------------------------------------* START-OF-SELECTION. cl_gui_frontend_services=>directory_browse( EXPORTING window_title = 'Folder selection' CHANGING selected_folder = gv_folder EXCEPTIONS OTHERS = 4 ). CHECK sy-subrc EQ 0. cl_gui_frontend_services=>directory_list_files( EXPORTING directory = gv_folder files_only = 'X' CHANGING file_table = gt_files[] count = gv_no_files EXCEPTIONS OTHERS = 4 ). CHECK sy-subrc EQ 0 AND gv_no_files GT 0. CREATE OBJECT go_zipper. FIND ALL OCCURRENCES OF '\' IN gv_folder IN CHARACTER MODE RESULTS gv_results. DESCRIBE TABLE gv_results LINES gv_lines. READ TABLE gv_results INTO gv_result INDEX gv_lines. ADD 1 TO gv_result-offset. gv_folder_name = gv_folder+gv_result-offset. LOOP AT gt_files. MOVE gt_files TO gv_file. CONCATENATE gv_folder '\' gv_file INTO gv_file_fullpath. cl_gui_frontend_services=>gui_upload( EXPORTING filename = gv_file_fullpath filetype = 'BIN' IMPORTING filelength = gv_file_length CHANGING data_tab = gt_filebincontent EXCEPTIONS OTHERS = 4 ). CHECK sy-subrc EQ 0. CALL FUNCTION 'SCMS_BINARY_TO_XSTRING' EXPORTING input_length = gv_file_length IMPORTING buffer = gv_filehexcontent TABLES binary_tab = gt_filebincontent EXCEPTIONS failed = 1 OTHERS = 2. CHECK sy-subrc EQ 0. *Populate folder name & file name CONCATENATE gv_folder_name '\' gv_file INTO gv_file. go_zipper->add( name = gv_file content = gv_filehexcontent ). ENDLOOP. gv_zipfilehex = go_zipper->save( ). CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = gv_zipfilehex TABLES binary_tab = gt_zipfilebin. CONCATENATE gv_folder '.zip' INTO gv_zipfilename. CALL METHOD cl_gui_frontend_services=>gui_download EXPORTING filename = gv_zipfilename filetype = 'BIN' CHANGING data_tab = gt_zipfilebin EXCEPTIONS OTHERS = 4.
发表评论
-
DISABLE button(FCODE) from the GUI-Status
2014-08-04 15:54 5741. Goto-> Attributes->Pus ... -
Handy SAP function module to automate user events
2013-11-28 09:49 696*Begin-Auto triggers ENTER comm ... -
set Billing block to blank for Sals Order
2013-04-17 15:16 744FM: SD_WF_ORDER_DEL_BILLING_BLO ... -
set Billing block to blank for Sals Order
2013-04-17 15:16 714FM: SD_WF_ORDER_DEL_BILLING_BLO ... -
Unpermitted combination of business object BUS2032 and sales doc. category H
2013-01-25 14:20 4049Q: create New Sales Order using ... -
Function Module: get all users who have specific role
2013-01-25 14:16 588CALL FUNCTION 'RSRA_USERS_O ... -
Create a SELECT-OPTIONS in a module pool screen
2012-03-07 15:35 987source:http://abap-explorer.blo ... -
Converting OTF data from script to Spool Request
2012-03-06 17:25 0source:http://forums.sdn.sap.co ... -
Calculate the days, months and years between 2 dates.
2012-02-21 16:14 794FORM compute_2date_diff. DAT ... -
Retrieving Domain fixed values
2012-02-16 11:13 783source:http://www.saptechnical. ... -
If 1 equals 2, what’s the purpose?
2012-02-16 10:59 794source:http://sapport.blogspot. ... -
get status name for batch input session
2012-01-31 14:47 887Line 601 in program SAPMSBDC_CC ... -
MIRO
2011-11-29 10:39 2030from: http://help-sap.blogspot. ... -
Create Vendor or Customer_master Data
2011-11-23 16:22 2847To Create or Change Vendor_mast ... -
Pay attention to the following points when using append structures
2011-10-27 13:43 1273You cannot create append str ... -
Help Views
2011-10-20 10:46 690source:http://help.sap.com/saph ... -
What is the Different Types and Usage of Views
2011-10-19 23:06 811source:http://www.sap-img.com/a ... -
Upload a Comma Delimited CSV file that contains commas in data
2011-09-23 17:22 2190source:http://wiki.sdn.sap.com/ ... -
What is the difference between SET SCREEN and CALL SCREEN ?
2011-09-19 21:50 700source:http://www.saptechies.co ... -
cl_gui_frontend_services=>file_open_dialog
2011-09-09 09:21 1376CALL METHOD cl_gui_frontend_ser ...
相关推荐
Create_folder_for_file.exe 快速为一个文件创建同名的文件夹。 windows10 VS2019 C# 制作
duilib写的仿文件夹,支持左键点击修改编辑,右键点击弹出响应
best oneclick adb software for windows
New Compressed (zipped) Folder_capacity_源码
简单的背景更新,可用于步态识别预处理的参考例子
CROSS-THREADING-SAFE, you can select a directory, you can start/stop/pause/continue the scan, and you will see the scanned dir´ s/file´ s in a listview :o)
一个MATLAB/Simulink模型,关于电动汽车动力电池荷电状态(State of Charge,SOC)估计; 包括参数文件、模型文件两种,模型文件分别仿真了110A恒流、110A脉冲和ECE15工况; 建模采用基于PEGV的电池等效模型对SOC...
可实现labview虚拟锁相,不必通过硬件来实现
smc controller for speed control in pMSG
TEST FUNCTION TO CHECK MULTI-OBJECTIVE ANT-LION OPTIMIZER ALGORITHM
paper about ldpc
Combine the algorithm mopso and qpso in such a way that half the particles are updated by the algorithm qpso and the other half by the algorithm pso.
特斯拉灯光秀工程文件
含风力发电机的电网系统,实时调度,频率控制,可变负荷
杀毒kill_folder_2.31_XiaZaiBa.
无需注册,简单实用Wise_Folder_Hider_1.3.2
matlab各种典型应用实例加+Joyce+Van+de+Vegte著
image in mimo ofdm in transmission in receiver side
matlab code to detect ROI
fail_to_use_service_name_to_access_share_folder_in_Win2008_cluster