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: 

CR+LF inserts blank line to file

Former Member
0 Kudos
465

Hi!

We have a program that generates a file which is spooled into another system. The program just creates the file and a script transfers the file to the other system. But when it is received in the other system, there are blank lines after each line of data. Should we change anything in the code to ensure that blank lines will not be inserted?

Thanks,

Irene

4 REPLIES 4

Former Member
0 Kudos
141

Please check if TRANSFER with addition <b>LENGTH</b> helps???

Kind Regards

Eswar

Former Member
0 Kudos
141

Hi Irene,

You can use class CL_ABAP_CHAR_UTILITIES for the purpose.

The class defines a number of constants for Line feed and carriage returns.

In your program, u can just write.

Replace CL_ABAP_CHAR_UTILITIES->CR_LF with SPACE.

By doing this, u replace all the CR+LF in your string to SPACE.

Regards,

Mahesh

Former Member
0 Kudos
141

use the length option with transfer staement while writting your record to your file.

e.g.- if your recorde length is 269 character.

loop at ITAB..

transfer ITAB to file_name length 269.

endloop.

0 Kudos
141

instead of using CR_LF caharcter use newline.

move move cl_abap_char_utilities=>NEWLINE to last character of your record. or

transfer move cl_abap_char_utilities=>NEWLINE to file_name.