ABAP下载txt文件
Posted Rainystuday
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ABAP下载txt文件相关的知识,希望对你有一定的参考价值。
IF NOT DOWN_F[] IS INITIAL.
CASE DOWN_MODE . "下载模式是放在所选路径下的.TXT文档中
WHEN \'X\' .
CALL FUNCTION \'WS_DOWNLOAD\'
EXPORTING
CODEPAGE = FILE_ENCODING
FILENAME = P_FILE
* filetype = \'ASC\'
* trunc_trailing_blanks = \'X\'
TABLES
DATA_TAB = DOWN_F
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
WHEN SPACE .
* CALL FUNCTION \'LIST_TO_ASCI\'
* EXPORTING
* LIST_INDEX = LIST_INDEX
* TABLES
* LISTASCI = DOWN_F
* LISTOBJECT = ABAP_LIST
* EXCEPTIONS
* LIST_INDEX_INVALID = 1
* OTHERS = 2.
* IF SY-SUBRC <> 0.
* Clear MSG_STR . MSG_STR = \'error in convert ASCII\' .
* MESSAGE MSG_STR TYPE \'E\' .
* ENDIF.
*
CALL FUNCTION \'GUI_DOWNLOAD\'
EXPORTING
CODEPAGE = FILE_ENCODING
FILENAME = FILENAME
FILETYPE = \'ASC\'
TRUNC_TRAILING_BLANKS = \'X\'
TABLES
DATA_TAB = DOWN_F
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
WHEN OTHERS .
ENDCASE.
IF SY-SUBRC = 0 .
MESSAGE TEXT-004 TYPE \'S\' .
ENDIF.
ENDIF.
以上是关于ABAP下载txt文件的主要内容,如果未能解决你的问题,请参考以下文章