Application Development 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: 

Writing the data from the internal table to the UNIX file

former_member687052
Participant
0 Kudos

Hi,

I have a program where I am retreiving the data from the database tables and writing the data to the application server file which was provided in the selection screen.

I am done with retrieving the data. I have the data in the internal table T_TOTAL. and the P_UNIX is the file path.

This is the code I wrote.

OPEN DATASET p_unix FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT t_total ASSIGNING <fs_total>.

TRANSFER <fs_total> TO p_unix.

ENDLOOP.

CLOSE DATASET p_unix.

While executing the program, it is going to DUMP at the TRANSFER statement and saying that <fs_total> should be of type CHAR. Can someone tell me how to transfer the complete record from an internal table to the UNIX file. My requirement is to write all the records one by one into the UNIX file.

Thanks in advance.

Best Regards,

Paddu.

2 REPLIES 2

Former Member
0 Kudos

Hi,

Try to use work area instead of fieldsymbols.

Rgds,

Bujji

Former Member
0 Kudos

Hi Paddu,

The issue is the file being downloaded / transferred to application server will accept only character data/string format.

Hence create a data variable of type STRING called v_string.

Concatenate all the columns of internal table T_TOTAL into the string v_String and then TRANSFER this v_string to the file.

Cheers,

Aditya