原文:
http://www.itpub.net/thread-1368352-1-1.html
這樣就可以用後台的方式正常往ftp傳輸漢字了。
"把內表數據用此函數SCMS_TEXT_TO_BINARY轉換成2進制;
然後再FTP_R3_TO_SERVER用這個函數傳ftp 注意用BLOB = IN_DATA 和 BLOB_LENGTH = LEN
CALL FUNCTION 'SCMS_TEXT_TO_BINARY'
IMPORTING
OUTPUT_LENGTH = LEN
TABLES
TEXT_TAB = CONTENT
BINARY_TAB = IN_DATA
EXCEPTIONS
FAILED = 1
OTHERS = 2.
CLEAR CONTENT[].
REFRESH RESULT.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = HDL
COMMAND = 'ascii' "'binary' "
TABLES
DATA = RESULT
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = HDL
COMMAND = 'cr'
TABLES
DATA = RESULT
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = FILENAME
BLOB_LENGTH = LEN
* CHARACTER_MODE = 'X'
TABLES
* TEXT = IN_DATA
BLOB = IN_DATA
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
IF SY-SUBRC <> 0.
MESSAGE = '往FTP服務器寫數據失敗。'.
EXIT.
ENDIF.
ENDIF.
沒有留言:
張貼留言