码迷,mamicode.com
首页 > 其他好文 > 详细

ABAP下载txt文件

时间:2017-01-06 23:55:32      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:batch   init   nload   error   pac   let   val   下载   text   

技术分享

 

 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文件

标签:batch   init   nload   error   pac   let   val   下载   text   

原文地址:http://www.cnblogs.com/rainysblog/p/6257540.html

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 mamicode.com 版权所有 京ICP备13008772号-2
迷上了代码!