Write data to the file on presentation server
* Transfer the data into desktop or presentation server.
* Task: I want to see student details in local system not in sap table based on student id.
Code
REPORT zajay_file_download.
TABLES:zajay_zstu.
TYPES: BEGIN OF ty_zstu,
zst_id TYPE zajay_zstu-zst_id,
zst_name TYPE zajay_zstu-zst_name,
zst_dept TYPE zajay_zstu-zst_dept,
zst_fee TYPE zajay_zstu-zst_fee,
END OF ty_zstu.
data: it_zstu type table of ty_zstu,
wa_zstu type ty_zstu.
select-OPTIONS : s_id for zajay_zstu-zst_id.
IF s_id is NOT INITIAL.
SELECT zst_id
zst_name
zst_dept
zst_fee
from zajay_zstu
into TABLE it_zstu
WHERE zst_id in s_id.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Users\JFR2KOR\Desktop\student details.txt'
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = it_zstu.
* Create a empty text file.
Input
* After successful execution
Output
* Initially file is empty.
* Check that student details text file.
Table
Comments
Post a Comment