sap 开发ftp功能需要的一些函数
1.call function 'HTTP_SCRAMBLE' "获取加密密码
exporting
source = ftp_pwd
sourcelen = dstlen
key = key "26101957 不能改
importing
destination = ftp_pwd.
2.call function 'FTP_CONNECT' "连接ftp服务器
exporting
user = ftp_user
password = ftp_pwd
host = ftp_host
rfc_destination = dest
importing
handle = hdl_1 "连接的句柄
exceptions
not_connected = 1
others = 2.
3. call function 'FTP_COMMAND' "执行FTP命令
exporting
handle = p_hdl_1 "连接句柄
command = l_ftpcommand "命令
tables
data = ftp_result "返回信息
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.
4. call function 'FTP_SERVER_TO_R3' "拷贝ftp服务器文件到r3
exporting
handle = hdl_1
fname = dest_filename
character_mode = 'X'
tables
text = itab_file.
5. call function 'FTP_COPY' "拷贝文件到指定位置
exporting
handle_source = hdl_1
handle_destination = hdl_2
file_source = dest_filename
file_destination = dest_filename
tables
data = ftp_result
exceptions
others = 1.
call function 'SCMS_TEXT_TO_BINARY'
importing
output_length = blob_length
tables
text_tab = itab_file
binary_tab = bindata
exceptions
failed = 1
others = 2.