Chinaunix首页 | 论坛 | 博客
  • 博客访问: 174649
  • 博文数量: 22
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 345
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 11:07
文章分类

全部博文(22)

文章存档

2011年(1)

2009年(2)

2008年(19)

我的朋友

分类:

2008-10-28 21:41:45

*&---------------------------------------------------------------------*
*& Report  ZB_CREATE_BAT_FILE                                          *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*
REPORT  ZB_CREATE_BAT_FILE                      .
DATA: BEGIN OF LOG,
        text(100)  TYPE C,
      END OF LOG.
DATA: ITAB_LOG  LIKE TABLE OF LOG WITH HEADER LINE.
*Define Selection Screen.
SELECTION-SCREEN BEGIN OF BLOCK BK WITH FRAME TITLE TEXT-001.
PARAMETERS: LOGFILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK BK.
INITIALIZATION.
  MOVE 'C:\STOCK_Log.bat' TO LOGFILE.
START-OF-SELECTION.
  LOG-text = 'del /q e:\a\*.*'.
  APPEND LOG TO ITAB_LOG.
END-OF-SELECTION.
  CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      FILENAME                = LOGFILE
      FILETYPE                = 'ASC'
    TABLES
      DATA_TAB                = ITAB_LOG
    EXCEPTIONS
      INVALID_FILESIZE        = 1
      INVALID_TABLE_WIDTH     = 2
      INVALID_TYPE            = 3
      NO_BATCH                = 4
      UNKNOWN_ERROR           = 5
      GUI_REFUSE_FILETRANSFER = 6
      CUSTOMER_ERROR          = 7
      OTHERS                  = 8.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  CALL FUNCTION 'GUI_EXEC'
    EXPORTING
      COMMAND          = 'C:\STOCK_Log.bat'
*     PARAMETER        =
*   IMPORTING
*     RETURNCODE       =
            .
阅读(1490) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~