cancel
Showing results for 
Search instead for 
Did you mean: 

Mail receiver adapter - line feed problem

Former Member
0 Kudos

Hi!

I am just configuring a mail receiver adapter. In the module tab i configured a conversion from XML to plain which works well. The plain text file is created but there are no line feeds after the plain text lines.

The configuration in the module tab looks like this:

Modulename: localejbs/AF_Modules/MessageTransformBean

Type: Local Enterprise Bean

Module key: XML2Plain

<u>Module configuration:</u>

XML2Plain - Transform.Class - com.sap.aii.messaging.adapter.Conversion

XML2Plain - Tansform.ContentType - text/plain;charset=utf-8

XML2Plain - xml.conversionType - SimpleXML2Plain

XML2Plain - xml.addHeaderLine - 0

XML2Plain - xml.fieldFixedLengths - 80,80,80,80,80,80

XML2Plain - xml.fixedLengthTooShortHandling - Cut

Can anybody please help me?

Thanks in advance

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

Try the below

xml.endSeparator=\n (or '0x0D' and/or '0x0A')

check this link as well

Hope this fixes your issue

Regards

Vishnu

Former Member
0 Kudos

Hi Vishnu,

thank you very much for your answer.

Unfortunately both suggestions did not work.

Thanks

Chris

stefan_grube
Active Contributor
0 Kudos

Use the module ConvertCRLFfromToLF to convert the Unix /n to Windows /n

see here:

http://help.sap.com/saphelp_nw04/helpdata/en/96/f04142099eb76be10000000a155106/content.htm

In the documentation the parameter is mentioned as <i>convert</i>, but in the source code the name is <i>mode</i>, maybe you try both

regards

Stefan

Former Member
0 Kudos

Hi Stefan!

Thanks for your reply! Your suggestions would be perfect if I already had any kind of line break, eg. lf or crlf. At the moment there is no separator at the end of each line.

<u>The XML file looks like this:</u>

<b> <?xml version="1.0" encoding="UTF-8" ?>

<ns:X_ANSI_TXT xmlns:ns="urn:customer.com:edi:kunden">

<MSG>

<LINE_01>*** START OF REPORT ***</LINE_01>

<LINE_02>PO CHANGE REQUEST</LINE_02>

<LINE_03>DATE: 10/05/05 TIME: 0744</LINE_03>

<LINE_04 />

<LINE_05>PO TYPE: CR: Change to Release</LINE_05>

<LINE_06>PO #: DB65544027560070</LINE_06>

<LINE_07>ORIGINAL PO DATE: 02/03/93</LINE_07>

<LINE_08>PO CHANGE REQUEST DATE: 10/05/05</LINE_08>

<LINE_09>SHPMT PMT METHOD: CC: COLLECT</LINE_09>

<LINE_10>FOB POINT: OR:ORIGIN (SHIPPNG PT)</LINE_10>

<LINE_11>FOB DESCRIPTION: ORIGIN (SHIPPNG PT)</LINE_11>

<LINE_12>*** END OF REPORT *** </LINE_50>

<LINE_13 />

</MSG></b>

<u>After conversion the output looks like this:</u>

<b>*** START OF REPORT *** PO CHANGE REQUEST DATE: 10/05/05 TIME: 0744 PO TYPE: CR: Change to Release PO #: DB65544027560070 ORIGINAL PO DATE: 02/03/93 PO CHANGE REQUEST DATE: 10/05/05 SHPMT PMT METHOD: CC: COLLECT FOB POINT: OR:ORIGIN (SHIPPNG PT) FOB DESCRIPTION: ORIGIN (SHIPPNG PT) *** END OF REPORT ***</b>

<u>I would like to create a more readable format like this:</u>

<b>*** START OF REPORT ***

PO CHANGE REQUEST

DATE: 10/05/05 TIME: 0744

PO TYPE: CR: Change to Release

PO #: DB65544027560070

ORIGINAL PO DATE: 02/03/93

PO CHANGE REQUEST DATE: 10/05/05

SHPMT PMT METHOD: CC: COLLECT

FOB POINT: OR:ORIGIN (SHIPPNG PT)

FOB DESCRIPTION: ORIGIN (SHIPPNG PT)

      • END OF REPORT ***</b>

Do I have to change the XML message or is there a chance to use a module entry?

Kind regards

Chris

Former Member
0 Kudos

Hi Chris,

Can you try xml.fieldSeparator (with the values in my earlier reply)

Regards

Vishnu

stefan_grube
Active Contributor
0 Kudos

No I see the problem. In fact you have only one line in the source structure.

Did you test with prameter

xml.fieldSeparator?

You could put your '0x0D''0x0A' here.

Otherwise you have to map your structure to something like

<MSG>

<LINE>*** START OF REPORT ***</LINE>

</MSG>

<MSG>

<LINE>PO CHANGE REQUEST</LINE>

</MSG>

<MSG>

<LINE>DATE: 10/05/05 TIME: 0744</LINE>

</MSG>

<MSG>

...

Regards

Stefan

Former Member
0 Kudos

Hi Vishnu! Hi Stefan!

It worked! Thank you very much for your help!

For all others who may have the same problem this is the line I used as module config:

<b>XML2Plain - xml.fieldSeparator - '0x0D''0x0A'</b>

Kind regards

Chris

Answers (1)

Answers (1)

maciej_klimkowski
Discoverer
0 Kudos

Hi!

There probably are line feeds, but unix style. If you need windows style line feeds, add following line to module configuration:

XML2Plain - line.separator - 0A0C

br,

Maciej

Former Member
0 Kudos

Hi Maciej!

Thanks for your comment; i tried it but it didn`t work.

Kind regards

Chris