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: 

TRANSFER statement issue

0 Kudos

task: upload a text file from desktop to unix

step 1. CALL FUNCTION 'GUI_UPLOAD' upload desktop text file into it_tab

step 2. Open data set, Loop on it_tab into Field symbol

step 3. Transfer field symbol to output file path

uploading a file is successful with each row 579 char

now it_tab has each row 579 char

when i try to transfer to opened file, it writes only 255 char

i tried length too, it didnt work

please advise

types: begin of st_tab,

line(3000) type c,

end of st_tab.

data: it_tab type standard table of st_tab with header line,

OPEN DATASET p_FILE FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC = 0.

LOOP AT it_tab ASSIGNING <lfs_outfile>.

DESCRIBE FIELD <lfs_outfile> LENGTH lv_len.

TRANSFER <lfs_outfile> TO p_FILE LENGTH lv_len.

ENDLOOP.

WRITE: 'The report is written to unix file'.

ELSE.

WRITE: 'The report output could not be written to unix file'.

endif.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

There is a display restriction of 255 chars when you open the file in AL11. But the whole file will be stored. To check this use the transaction CG3Y to download the file to the presentation server again and check

Vikranth

6 REPLIES 6

Former Member
0 Kudos

Hi,

OPEN DATASET p_FILE FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC = 0.

LOOP AT it_tab ASSIGNING <lfs_outfile>.

DESCRIBE FIELD <lfs_outfile> LENGTH lv_len.

TRANSFER <lfs_outfile> TO p_FILE LENGTH lv_len.

ENDLOOP.

WRITE: 'The report is written to unix file'.

ELSE.

WRITE: 'The report output could not be written to unix file'.

endif.

While Transferring why u are using LENGTH.

Remove that try to transfer..

Former Member
0 Kudos

There is a display restriction of 255 chars when you open the file in AL11. But the whole file will be stored. To check this use the transaction CG3Y to download the file to the presentation server again and check

Vikranth

former_member209217
Active Contributor
0 Kudos

Hi,

In AL11 transaction You'll be able to see upto 255 characters only. To see the complete file download it to presentation server using CG3Y transaction. Else, check the file directly in application server system.

Regards,

Lakshman.

0 Kudos

guys

i appreciate your quick response, but in itab before i write, each row has 574char

once i transfer to unix file first 255 char is stored on appl server

as you suggested i downloaded the file to desktop and i see the same as i see on AL11, data above 255 char got truncated

please advise

0 Kudos

What is the value of LV_LEN after the DESCRIBE statement?

Rob

0 Kudos

LV_LEN gives me 574 hence i understand that itab has all the data from text file uploaded