• 上传下载函数


    DATA GT_01 TYPE STANDARD TABLE OF MARA.
    DATA G1 TYPE STRING.
    DATA GT_02 TYPE  TABLE OF ALSMEX_TABLINE.
    DATA G2 TYPE RLGRAP-FILENAME.
    SELECT *
      FROM MARA
      INTO CORRESPONDING FIELDS OF TABLE GT_01 UP TO 10 ROWS.
      CALL FUNCTION 'WS_FILENAME_GET'
    *   EXPORTING
    *     DEF_FILENAME           = ' '
    *     DEF_PATH               = ' '
    *     MASK                   = ' '
    *     MODE                   = ' '
    *     TITLE                  = ' '
       IMPORTING
         FILENAME               = G2
    *     RC                     =
    *   EXCEPTIONS
    *     INV_WINSYS             = 1
    *     NO_BATCH               = 2
    *     SELECTION_CANCEL       = 3
    *     SELECTION_ERROR        = 4
    *     OTHERS                 = 5
                .
      IF SY-SUBRC <> 0.
    * Implement suitable error handling here
      ENDIF.

    *CALL FUNCTION 'GUI_DOWNLOAD'
    *  EXPORTING
    **   BIN_FILESIZE                    =
    *    FILENAME                        = G1
    *   FILETYPE                        = 'DAT'
    **   APPEND                          = ' '
    **   WRITE_FIELD_SEPARATOR           = ' '
    **   HEADER                          = '00'
    **   TRUNC_TRAILING_BLANKS           = ' '
    **   WRITE_LF                        = 'X'
    **   COL_SELECT                      = ' '
    **   COL_SELECT_MASK                 = ' '
    **   DAT_MODE                        = ' '
    **   CONFIRM_OVERWRITE               = ' '
    **   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = '8404'
    **   IGNORE_CERR                     = ABAP_TRUE
    **   REPLACEMENT                     = '#'
    **   WRITE_BOM                       = ' '
    **   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    **   WK1_N_FORMAT                    = ' '
    **   WK1_N_SIZE                      = ' '
    **   WK1_T_FORMAT                    = ' '
    **   WK1_T_SIZE                      = ' '
    **   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    **   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    **   VIRUS_SCAN_PROFILE              = '/SCET/GUI_DOWNLOAD'
    ** IMPORTING
    **   FILELENGTH                      =
    *  TABLES
    *    DATA_TAB                        = GT_01
    **   FIELDNAMES                      =
    ** EXCEPTIONS
    **   FILE_WRITE_ERROR                = 1
    **   NO_BATCH                        = 2
    **   GUI_REFUSE_FILETRANSFER         = 3
    **   INVALID_TYPE                    = 4
    **   NO_AUTHORITY                    = 5
    **   UNKNOWN_ERROR                   = 6
    **   HEADER_NOT_ALLOWED              = 7
    **   SEPARATOR_NOT_ALLOWED           = 8
    **   FILESIZE_NOT_ALLOWED            = 9
    **   HEADER_TOO_LONG                 = 10
    **   DP_ERROR_CREATE                 = 11
    **   DP_ERROR_SEND                   = 12
    **   DP_ERROR_WRITE                  = 13
    **   UNKNOWN_DP_ERROR                = 14
    **   ACCESS_DENIED                   = 15
    **   DP_OUT_OF_MEMORY                = 16
    **   DISK_FULL                       = 17
    **   DP_TIMEOUT                      = 18
    **   FILE_NOT_FOUND                  = 19
    **   DATAPROVIDER_EXCEPTION          = 20
    **   CONTROL_FLUSH_ERROR             = 21
    **   OTHERS                          = 22
    *          .
    *IF SY-SUBRC <> 0.
    ** Implement suitable error handling here
    *DATA GT_02 TYPE  TABLE OF ALSMEX_TABLINE.
    *DATA G2 TYPE RLGRAP-FILENAME.
           CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
               FILENAME                      = G2
               I_BEGIN_COL                   1
               I_BEGIN_ROW                   1
               I_END_COL                     10
               I_END_ROW                     10
             TABLES
               INTERN                        = GT_02
    *        EXCEPTIONS
    *          INCONSISTENT_PARAMETERS       = 1
    *          UPLOAD_OLE                    = 2
    *          OTHERS                        = 3
                     .
           IF SY-SUBRC <> 0.
    * Implement suitable error handling here
           ENDIF.
    *ENDIF.
     BREAK-POINT.

  • 相关阅读:
    Solaris安装pkg
    JSP路径出现问题
    错误卸载软件导致Windows7系统中的软件无法播放视频
    蛋疼的Solaris设置
    SQL运行突然SESSION中断错误
    JAVA利用Zip4j解压缩
    java解压缩/压缩/加密压缩/加密解压缩 ZIP4J---ZIP文件压缩与解压缩学习
    未得冠军的运动员也有教练——Leo鉴书71
    VS2008 编译SQLite 3.8.4.3 + sqlcipher-3.1.0 + openssl-1.0.1g
    Android数据库安全解决方案,使用SQLCipher进行加解密
  • 原文地址:https://www.cnblogs.com/salah/p/11935188.html
Copyright © 2020-2023  润新知