on 03-31-2015 2:19 PM
The outfile generated is like this
E1MARAM | 00000000000000l1f100000000000000l1f5l1f300000l1f4 | l1f8000001234.000 | l1f2l1f | l3f1 | l1f9 |
E1MARCM | l3f2 | ||||
Z1EDPAUSPM | l2f3 | l2f4 |
There is no extra space getting inserted after each segment if the last field does not come in XML. In the above file, in E1MARAM the fields corresponding to fixed lengths 3 & 18 did not come. Can you please help me in resolving this issue. The requirement is that at the end there should be trailing spaces as per the fixed length in case if the last field does not come in the XML. I tried adding map with default but still it is not preserving the trailing whitespaces.
Thanks in advance,
Sushobhan
Sushobhan,
Try this solution
1. In message mapping, for the last field mapWithDefault " ." (there are 18 spaces and then a period).
2. In StrictXml2PlainBean
xml.E1MARAM.fieldLengthExceeded | cut |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think fieldcontentformating is applicable for receiver (xml to plain conversion). So remove that.
And when you test your mapping, do you see spaces in test tab? you can check it in xm view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you can see the spaces post mapping, then just fieldFixedLengths should work.
Make sure that there are no additional spaces/typo's in any of the MTB properties. May be recreate the channel
If you still face any issue, follow Greg's suggestion to maintain length's in Data type and see if that helps..
Just to confirm Hareesh's advise. As long as the last fields are there (which you can map with constant or mapWithDefault), the content conversion should populate trailing whitespaces up to the configured fixed length.
In Hareesh's own words "a picture is worth a thousand words" , here are three thousand words for you.
Here's the MTB config
Input XML file having additional whitespaces on the last fields of each segment type
Output flat file has the trailing white space. Note that even for Delivery1, even if there is no additional whitespace in the XML, it still populates up to the configured length.
By the way, there are a lot of extraneous parameters in your setting that you don't really need. You can safely remove endSeparator, fieldContentFormatting, absoluteRowWidth. For further details of what parameter is available for each conversion type, you can check out the document below.
Rgds
Eng Swee
Hi Eng,
My requirement was not that.Actually spaces were coming when values were there. However it is working now using Adding StrictXml2PlainBean (XML to Text) in the Module Processor - Adding Modules to the Module Proc...
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 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.