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: 

open dataset character limit problem in text mode

Former Member
0 Kudos

I am uploading a text file to application server and i fill this text file with my structure.

But when i check it from AL11 i see that half of my structure isnt transferred.

I use the code below.

Should i do it in binary mode? If so how can i change my structure to binary mode?

One more point : i want to split the datas as tab delimited in s_record structure. How can i do it?

Thanks in advance.

CONCATENATE e_file sy-datum sy-uzeit '.CMD' INTO e_file2.

      OPEN DATASET e_file2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

      TRANSFER s_record TO e_file2.

      CLOSE DATASET e_file2.

Edited by: aydnbk on Nov 4, 2011 2:42 PM

Edited by: aydnbk on Nov 4, 2011 2:42 PM

3 REPLIES 3

Former Member
0 Kudos

Hi,

How is your structure defined?

Well anyway, if you want to have all fields separated by tabulation in your dataset, you will have to loop on each field of your structure and concatenate them all separated by cl_abap_char_utilities=>horizontal_tab into e.g. a new string variable. Then write that variable to your dataset.


DO.
  ASSIGN COMPONENT sy-index of STRUCTURE s_record to <fld>.
  IF sy-subrc NE 0. EXIT. ENDIF.
  IF sy-index = 1.
     l_str = <fld>.
  ELSE.
    CONCATENATE l_str <fld> INTO l_str SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
  ENDIF.
ENDDO.
TRANSFER l_str TO e_file2.

Hope this helps,

Kr,

Manu.

Former Member
0 Kudos

AL11 displays only the first 512 characters of each line and If your file line ( S_RECORD length ) has more than 512 character you will see it truncated. To verify that the file is written completely, Download the file to presentation server through CG3Y and you will be able to see the complete file.

0 Kudos

CG3Y also truncates the data....GUI_DOWNLOAD will, on the other hand, support up to 1024 characters...This has been asked so many times....search the forums..... AL11 and CG3Y are old and have limitations that would lead an inexperienced developer to believe the data was not correct. Look at the data with appropriate tools that will show the entire file width.