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

Create .txt file

Former Member
0 Likes
1,488

Hi all,

could you show me the example ABAP code how create writethe .txt file. And how write CRLF during create this file.

Thanls a lot.

Hi all,

could you show me the example ABAP code how create writethe .txt file. And how write CRLF during create this file.

Thanls a lot.

2 REPLIES 2
Read only

athavanraja
Active Contributor
0 Likes
1,019

for creating files on the application server use OPEN DATASET COMMAND. For more on thiis check out the ABAP Key work documentation.

open dataset <file name with path> for output in text mode.

transfer <data> to <filename with path> .

close dataset <filename with path>.

And for CRLF

concatenate <b>string1</b> cl_abap_char_utilities=>cr_lf <b>string2</b> to <b>strings</b> .

Regards

Raja

Read only

andreas_mann3
Active Contributor
0 Likes
1,019

Hi,

you need 3 commands (look F1 too!)

to create file on application server:

1) open dataset file for output in text mode

2) loop at itab.

transfer itab to file.

endloop.

3) close dataset file

regards Andreas