首页 > 其他 > 详细

ABAP下载txt文件

时间:2017-01-06 23:53:20      阅读:512      评论:0      收藏:0      [点我收藏+]

技术分享

 

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!