Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

open dataset

Former Member
0 Likes
563

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 ??

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
536

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!!

4 REPLIES 4
Read only

Sm1tje
Active Contributor
0 Likes
537

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!!

Read only

Former Member
0 Likes
536

Hi Frds

Check this link

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/open_dat.htm

Reward Me Point

By

Pari

Read only

prasanth_kasturi
Active Contributor
0 Likes
536

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

Read only

Former Member
0 Likes
536

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