‎2008 Apr 18 12:19 PM
i have internal table it_output and i want to transfer it_output data to p_file on application server.
How to use open dataset for this ??
‎2008 Apr 18 12:23 PM
open dataset lv_name for input in text mode encoding default.
lv_name is the name of the path and file.
loop at itab into wa.
transfer wa to lv_name.
endloop.
close dataset lv_name.
F1 help on OPEN DATASET is also possible!!
‎2008 Apr 18 12:23 PM
open dataset lv_name for input in text mode encoding default.
lv_name is the name of the path and file.
loop at itab into wa.
transfer wa to lv_name.
endloop.
close dataset lv_name.
F1 help on OPEN DATASET is also possible!!
‎2008 Apr 18 12:23 PM
Hi Frds
Check this link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/open_dat.htm
Reward Me Point
By
Pari
‎2008 Apr 18 12:23 PM
hi,
use the following way
open dataset <filename> for o/p
in {text/binary mode}
encoding default.
regards
prasanth
if the file is not there it creates a file. binary mode is default
‎2008 Apr 18 12:36 PM
l_unix_file = <your filepath on Application server with filename you want to create>
OPEN DATASET l_unix_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Check that file opened without error.
IF sy-subrc NE 0.
<output error message>
ENDIF.
LOOP AT it_output. TRANSFER it_output TO l_unix_file.
ENDLOOP.
CLOSE DATASET l_unix_file.
Regards,
Mohaiyuddin