on 11-16-2005 3:29 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.