Skip to Content
Author's profile photo Matteo Galeazzi

How to force CR/LF on file adapter

SAP PI File adapter allows us to write files on a remote server through file system or FTP/SFTP protocols. PI seamlessly manages different operating systems and uses the default end-of-line character that is:

– CRLF for Windows systems;

– LF for Unix systems.

Anyway, we should be in need of producing a file with a specific end-of-line character, for example CRLF on Unix systems. This is a quite easy goal for SAP PI, you need just a couple of parameters on the Receiver File communication channel:

– open Integration Directory and edit your receiver CC;

– under the “Processing” tab you must specify “File type = Text”;

– you can also specify “File encoding = UTF-8” if you need it, but it’s non mandatory;

– under che “Content conversion” tab you must specify a property on each of your record types. The property you must set is endSeparator.

This property allows you to force a specific character (or characters) at the end of each line. The value of this property is one or more characters specified using their ASCII code; each code must be in the format 0x$$ where $$ is the hexadecimal value of the character, and must be between single quotes without any space.

As you can see on the ASCII table, the character “CR” (carriadge return) corresponds to the value 13 and the “LF” (line feed) corresponds to the value 10. Converting these numbers on hexadecimal format, and respecting the syntax explained below, we obtain the endSeparator property value:


Save and activate your CC, and you’re done!

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Rohit Sinha
      Rohit Sinha

      Hello Matteo,

      What if the receiver channel is SFTP and not file. How can we achieve carriage return line feed in the generated file?



      Rohit Sinha

      Author's profile photo Anuj Dulta
      Anuj Dulta

      Hi Rohit,


      Did you get this sorted? We are facing the same challenge to have output file with CRLF, since the target SFTP Server supports only that.




      Author's profile photo Anuj Dulta
      Anuj Dulta

      I got this sorted here...