*&---------------------------------------------------------------------*
*& 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) |