02-17-2011 7:52 PM
Here is the code i am using for open dataset and transfer, but giving LENGTH and NO END OF LINE also i am getting the line break
open dataset gv_fname for output in text mode encoding utf-8.
if sy-subrc <> 0.
raise open_data_set_error.
endif.
data : lv_ln type i.
lv_ln = strlen( it_istring ).
transfer it_istring to gv_fname length lv_ln NO END OF LINE .
close dataset gv_fname.
How to avoid line break
a®
02-17-2011 9:09 PM
Hi a®s,
it is not visible what the content and datatype of it_istring is.
replace all occurences of:
cl_abap_char_utilities=>cr in it_istring with '',
cl_abap_char_utilities=>cr_lf in it_istring with '',
cl_abap_char_utilities=>newline in it_istring with ''.
Regards,
Clemens
02-17-2011 9:09 PM
Hi a®s,
it is not visible what the content and datatype of it_istring is.
replace all occurences of:
cl_abap_char_utilities=>cr in it_istring with '',
cl_abap_char_utilities=>cr_lf in it_istring with '',
cl_abap_char_utilities=>newline in it_istring with ''.
Regards,
Clemens
02-17-2011 9:35 PM
Hi,
After giving your suggested code also still line break is showing
a®
02-17-2011 10:25 PM
Hi,
what is content and datatype of it_istring?
and where (how) do you see line break?
I will try.
Regards,
Clemens
02-18-2011 2:48 AM
The type it_istring is TPEC(3200) C. and content is simple XML tags in txt format i am seeing the cursor get stops in the nex lines when i open the file
a®
02-18-2011 4:28 AM
TRANSFER statement with text mode will by default adds a line break at the end of the line. Try opening the file in the binary mode, so that the string is preserved unless you pass explicit line breaks.
Regards
Ranganath
02-18-2011 10:06 AM
Hi a®s,
if I understand you right you did not identify any linefeed characters in the output file but the program you open the file with inserts the line breaks.
The question might be what you want to achieve.
You may open the file for input after writing and closing and then READ DATASET into a string. Then check what the string contains where you observe line breaks.
Regards,
Clemens
02-18-2011 3:34 PM
Also if your content is XML, open the file in notepad to see if there are linebreaks? May be the program that you are using for reading XML inserts the line break?
03-21-2024 8:22 PM
I know this is 13 years old...but if anyone is looking for the answer: use addition "NO END OF LINE" in your transfer statement to avoid the final line break.