DATA: fname TYPE rlgrap-filename,
ftype TYPE rlgrap-filetype,
fsize TYPE i.
DATA: fname_p TYPE string,
fname_n TYPE string.
DATA: sfname_p TYPE string .
DATA: sfname LIKE rcgiedial-iefile.
sfname_p = './'."model/sap/'.
DATA: r(1) TYPE c.
DATA: data_tab LIKE rcgrepfile OCCURS 10 WITH HEADER LINE.
DATA: lines TYPE i.
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = 'c:\'
filetype = 'BIN'
filetype_no_change = 'X'
IMPORTING
filesize = fsize
act_filename = fname
act_filetype = ftype
TABLES
data_tab = data_tab
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3.
fname_n = fname.
DO.
SPLIT fname_n AT '\' INTO fname_p fname_n.
SEARCH fname_n FOR '\'.
IF sy-subrc = 4.
EXIT.
ENDIF.
ENDDO.
fname_p = fname.
SHIFT fname_p RIGHT DELETING TRAILING fname_n.
SHIFT fname_p LEFT DELETING LEADING space.
CONCATENATE sfname_p fname_n INTO sfname.
*write:/,'sfname=',sfname,'|'.
DESCRIBE TABLE data_tab LINES lines.
CALL FUNCTION 'C13Z_RAWDATA_WRITE'
EXPORTING
i_file = sfname
i_file_size = fsize
i_lines = lines
TABLES
i_rcgrepfile_tab = data_tab
EXCEPTIONS
no_permission = 1
open_failed = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE i000(znyj13) WITH 'UPLOAD SUCC'.
ENDIF.
WRITE: 'SY-SUBRC:', sy-subrc,
/ '上载的本地文件名:', (60) fname,
/ '上载的远程文件名:',(60) sfname,
/ '文件类型:', ftype,
/ '文件大小:', fsize.
SKIP.
阅读(869) | 评论(0) | 转发(0) |