‎2008 Jul 31 9:18 AM
Hi,
I tried the following code for downloading data to PC in background:
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
LOOP AT itab INTO istab.
TRANSFER istab TO p_file.
ENDLOOP.
ENDIF.
Here, the contents are not getting transferred to the p_file. I give the path of the file while executing the program.
First of all, the file is not getting created in PC. And the statement 'OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT'. is working but unable to read after that using READ DATASET statement.
‎2008 Jul 31 11:18 AM
Hi,
This will create a file in the application server with the name you pass in p_file say '.\w_file.txt', check the file in AL11 after creating in.Use CG3y to download data into presentation server
Thanks & Regards,
Mani
‎2008 Jul 31 9:32 AM
This will create a file in the application server with the name you pass in p_file say '.\w_file.txt', check the file in AL11 after creating in.
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT itab INTO istab.
TRANSFER istab TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
‎2008 Jul 31 9:59 AM
HI,
You can use this code .............
OPEN DATASET gv_dataset for input in text mode encoding default.
IF sy-subrc = 0.
DO.
clear gv_rec.
READ DATASET gv_dataset INTO gv_rec.
if sy-subrc <> 0.
append gv_rec to gt_raw.
exit.
endif.
append gv_rec to gt_raw.
ENDDO.
CLOSE DATASET gv_dataset.
ELSE.
gv_retcode = 1.
ENDIF.
Regards,
jayan
‎2008 Jul 31 10:04 AM
Hi
If you need to transfer a file in Application server the addition FOR OUTPUT is right, so if you can't transfer any data, u should check if the system can create the file: so the value of SY-SUBRC.
U make sure the structure ISTAB has char field only.
Max
‎2008 Jul 31 11:18 AM
Hi,
This will create a file in the application server with the name you pass in p_file say '.\w_file.txt', check the file in AL11 after creating in.Use CG3y to download data into presentation server
Thanks & Regards,
Mani