REPORT CHAP2603.
* Data declarations for later use
PARAMETERS FILENAME(128) DEFAULT 'c:\users\default\testfile.dat'
LOWER CASE.
TABLES CUSTOMERS.
DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
WITH HEADER LINE.
* Get data for file transfer
SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.
SORT ALL_CUSTOMERS BY CITY.
LOOP AT ALL_CUSTOMERS.
WRITE: / ALL_CUSTOMERS-CITY,
ALL_CUSTOMERS-NAME.
ENDLOOP.
* Transferring Data
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = FILENAME
TABLES
DATA_TAB = ALL_CUSTOMERS
EXCEPTIONS
FILE_OPEN_ERROR = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN 1.
WRITE 'Error when file opened'.
EXIT.
WHEN 2.
WRITE 'Error during data transfer'.
EXIT.
ENDCASE.
ABAP,ABAP report,Interactive Report,ALV grid,ALV list,IDOC,User Exit,RFC,Smartform,sapscript,ABAP Performance,Remote Function Module( RFC ),Function Module,Modularization techniques,ABAP tools,ALV report Generator,ABAP Interview Questions,BDC,BAPI,ALE,BADI, EDI,InternalTable,DataStructure,LSMW,Domain,DataElement,Basis and Administration ,ABAP HR development,ABAP Debugger,BW,ExceptionHandling,Download FI, CO, MM, PP, SD, PM, PS, QM, SM, HR, BW, APO,ABAP Tutorial
Search on this Website
Sunday, June 6, 2010
Abap code for Transferring data to a file (presentation server)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment