声明:原创作品,转载时请注明文章来自SAP师太博客,并以超链接形式标明文章原始出处,否则将追究法律责任!
原文出自:
20.3. FTP
FTP_COMMAND
FTP_DISCONNECT
20.4. 文件读写
DATA: file TYPE string VALUE `jzjflights.dat`,
wa TYPE spfli.
OPEN DATASET file FOR OUTPUT IN BINARY MODE.
SELECT *
FROM spfli
INTO wa.
TRANSFER wa TO file. "写
ENDSELECT.
CLOSE DATASET file.
DATA: file TYPE string VALUE `jzjflights.dat`,
wa TYPE spfli.
OPEN DATASET file FOR INPUT IN BINARY MODE.
DO.
"由于没有使用MAXIMUM LENGTH选项,所以每次读取的最大字节数由wa所占字节数决定
READ DATASET file INTO wa. "读
IF sy-subrc = 0.
WRITE: / wa-carrid,
wa-connid,
wa-countryfr,
wa-cityfrom,
wa-cityto,
wa-fltime,
wa-distance.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET file.
时间: 2024-10-12 03:55:51