cancel
Showing results for 
Search instead for 
Did you mean: 

Replace CRLF Carriage Control with Line Feed in IDOC Text

Former Member
0 Kudos

Issue is I am receiving data in an inbound file with a carriage control character (Hex 0d0a). In the map I attempt to convert this character in the text with a line feed hex "0a"which will be mapped in an IDOC. The mapper doesn't not seem to convert from Carriage Control to Line feed. In the IDOC that is created ,the text within the segment has carriage control. Is this an issue in the mapper?

The code converts the charater \r to \n.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

why do you want to do so?

maybe use file adapter : binary mode , if your receiver system environment is LF, I can change the return conde.

Idoc adapter has no option to change return code, if use idoc adapter, you have to create Java mapping that convert return code.

Naoki

Answers (2)

Answers (2)

Former Member
0 Kudos

I mistyped earlier. We use string.replace('\r','\n'). This changes the carriage control from the 
 to a hex 0d 0a.

R/3 sees the 0d 0a as a '#'.

Former Member
0 Kudos

The file is designated as binary in the file adapter. We created java mapping to change the 
 which is the XML designation for carriage control. The code utilizes a string.replace('\r', '/n'). This results in no change but outputs a hex od 0a for carriage control.

If I replace('\r', ''), the change to '' occurs. The problem that I encounter is that once received by R3 with the hex 0d 0a and an invoice is printed, the carriage control is displayed as a '#' and causes the data to wrap. There are no separate lines. For example:

This is a test

This is a test

is displayed as

This is a test#This is a test

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>>The code utilizes a string.replace('\r', '/n'). This results in no change but outputs a hex od 0a for carriage control.

Have u tried string.replace ('\r','\n') ?