CSDN博客

img opparts

SAP ABAP/4学习---上传和下载(2)

发表于2004/10/17 20:07:00  4131人阅读

*&---------------------------------------------------------------------*
*& Report  ZSAP_SW_4                                                   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  ZSAP_SW_4                               .

******************************
*本地到服务器
******************************


*DATA: BEGIN OF ITAB OCCURS 0,
*        LINE(30),
*      END OF ITAB.
*
*DATA: F_NAME(20) VALUE 'F:/TEMP3.CSV'.
*
*ITAB-LINE = '1,1,1'.
*APPEND ITAB.
*ITAB-LINE = '2,2,2'.
*APPEND ITAB.
*ITAB-LINE = '3,3,3'.
*APPEND ITAB.
*
*OPEN DATASET F_NAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*  LOOP AT ITAB.
*    TRANSFER ITAB-LINE TO F_NAME.
*  ENDLOOP.
*CLOSE DATASET F_NAME.

 

************************************
*服务器到本地
************************************


DATA: BEGIN OF ITAB OCCURS 0,
        LINE(30),
      END OF ITAB.

DATA: F_NAME(20) VALUE 'F:/TEMP3.CSV'.

*DATA: T_STRING(40).

      OPEN DATASET F_NAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        CLEAR: ITAB,
               ITAB[].
        DO 3 TIMES.
          READ DATASET F_NAME INTO ITAB-LINE.
          APPEND ITAB.
        ENDDO.
      CLOSE DATASET F_NAME.

      LOOP AT ITAB.
        WRITE: / ITAB-LINE.
      ENDLOOP.

阅读全文
0 0

相关文章推荐

img
取 消
img