Monday, December 20, 2010
REPORT ZTEST_NOTEPAD.
DATA:
      BEGIN OF IT_DOWNLOAD OCCURS 0,
        DATA TYPE STRING,
      END OF IT_DOWNLOAD.
DATA:
      BEGIN OF IT_DATA OCCURS 0,
        ARBGB TYPE T100-ARBGB,
        MSGNR TYPE T100-MSGNR,
        X(5)  TYPE C,
        TEXT  TYPE T100-TEXT,
        Y(5)  TYPE C,
      END OF IT_DATA.
CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
CONSTANTS:
    CON_TAB  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
"START-OF-SELECTION
START-OF-SELECTION.
  SELECT * FROM T100 INTO CORRESPONDING FIELDS OF TABLE IT_DATA
  UP TO 100 ROWS WHERE SPRSL = SY-LANGU.
  "Populating tab delimited internal table
  LOOP AT IT_DATA.
    CONCATENATE IT_DATA-ARBGB
                IT_DATA-MSGNR
                IT_DATA-X
                IT_DATA-TEXT
                IT_DATA-Y
           INTO IT_DOWNLOAD-DATA SEPARATED BY CON_TAB.
    APPEND IT_DOWNLOAD.
    CLEAR  IT_DOWNLOAD.
  ENDLOOP.
  "Download
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME = 'C:\test.txt'
      FILETYPE = 'ASC'
    TABLES
      DATA_TAB = IT_DOWNLOAD.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.