FTP
-------------------------------------------------------------------------------
DATA: l_hdl TYPE i,
l_key TYPE i VALUE 26101957,
l_slen TYPE i,
l_compress TYPE c VALUE 'N',
l_ftp_filename(80) TYPE c,
l_cmd(80) TYPE c .
DATA: ls_result TYPE ts_cmd_result,
lt_result LIKE TABLE OF ls_result.
l_slen = STRLEN( pwd ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = pwd
sourcelen = l_slen
key = l_key
IMPORTING
destination = pwd.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = user
password = pwd
host = host
rfc_destination = dest
IMPORTING
handle = l_hdl.
*enter directory
CONCATENATE 'cd' pa_filea INTO l_cmd SEPARATED BY space.
PERFORM exec_command USING l_hdl l_cmd l_compress CHANGING lt_result.
"CONCATENATE host pa_filea INTO l_fname.
PERFORM filename_timestamp CHANGING l_ftp_filename.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = l_hdl
fname = l_ftp_filename
character_mode = 'X'
TABLES
text = gt_record.
IF sy-subrc = 0.
MESSAGE s013.
ENDIF.
* Disconnect
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
handle = l_hdl.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = dest
EXCEPTIONS
OTHERS = 1.
-------------------------------------------------------------------------------
FORM exec_command USING p_hdlp_cmd
p_compress
CHANGING pt_result TYPE tt_cmd_result.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = p_hdl
command = p_cmd
compress = p_compress
TABLES
data = pt_result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " EXEC_COMMAND
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8214011/viewspace-1060386/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 北大FTP,除了北大FTP其他好用的FTP軟體FTP
- 主動FTP與被動FTPFTP
- ftp,安全ftp軟體哪個好FTP
- centos ftpCentOSFTP
- ftp 配置FTP
- Ftp模式FTP模式
- ftp "CanFTP
- ftp serverFTPServer
- FTP,FTP連線的辦法,配置方式FTP
- FTP客戶端工具Yummy FTP Pro MacFTP客戶端Mac
- 免費ftp站點,使用三款ftp工具連線免費ftp站點FTP
- FTP,FTP該如何進行連線,如何配置FTP
- wing ftp server(ftp伺服器軟體)FTPServer伺服器
- ftp是什麼,ftp是什麼東西?FTP
- FTP學習FTP
- windows搭建ftpWindowsFTP
- 公網ftpFTP
- FTP工具類FTP
- ftp -- vsftpFTP
- FTP 命令大全FTP
- ftp指令碼FTP指令碼
- 【ABAP】FTP ProgramFTP
- 伺服器FTP工具,Windows伺服器FTP工具伺服器FTPWindows
- ftp工具,6款好用的ftp工具,來自運維人員好用的ftp工具推薦。FTP運維
- 免費的FTP工具,免費的FTP工具下載!FTP
- FTP工具中文版,FTP工具中文版下載FTP
- 綠色ftp工具,綠色ftp工具下載,使用教程。FTP
- ftp,ftp是幹什麼的,怎麼運用呢?FTP
- 簡單實用的FTP客戶端:Viper FTP for MacFTP客戶端Mac
- ftp的passive模式FTP模式
- PHPStorm 配置 FTPPHPORMFTP
- FTP工具FlashFXP PuTTYFTP
- FTP服務搭建FTP
- 配置ftp服務FTP
- 修改ftp密碼FTP密碼
- solaris 9 ftp 慢FTP
- rman 建立ftp standbyFTP
- C#FTP操作C#FTP