on 11-29-2006 5:25 PM
I'm having a problem where file content conversion is trimming leading blanks/space/whitespace from fields when reading in the inbound file. I've seen where people have posted that you need to use fieldContentFormatting to prevent content conversion from stripping the leading/trailing whitespace. I added that parameter to my list (see below example) but it still appears to be trimming the leading whitespace. Look forward to hearing your thoughts. Here are the details:
I'm using fixed length file content conversion for Sender File Adapter (SP15). I have the following parameters set:
Document Name = MaterialData
Recordset name = item
Recordset Structure = MaterialLine, 1
I have:
MaterialLine.fieldNames = matno_external, mat_description
MaterialLine.fieldFixedLengths = 40, 40
MaterialLine.fieldContentFormatting = nothing, nothing
The following is the input file (notice spaces prior to second occurrence of material numbers)
ZED00000001 AIMS LIGHT A
ZED00000001 AIMS LIGHT B
ZED00000002 AIMS SWITCH A
ZED00000002 AIMS SWITCH B
ZED00000003 AIMS SEMICONDUCTOR A
ZED00000003 AIMS SEMICONDUCTOR B
The following is the source XML after file content conversion from SXMB_MONI (note spaces no longer exist in matno_external tag).
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MaterialData xmlns:ns="http://xxxxxxx.com/yyy/test">
- <item>
- <MaterialLine>
<matno_external>ZED00000001</matno_external>
<mat_description>AIMS LIGHT A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000001</matno_external>
<create_date>10/09/06</create_date>
<mat_description>AIMS LIGHT B</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000002</matno_external>
<mat_description>AIMS SWITCH A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000002</matno_external>
<mat_description>AIMS SWITCH B</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000003</matno_external>
<mat_description>AIMS SEMICONDUCTOR A</mat_description>
</MaterialLine>
</item>
- <item>
- <MaterialLine>
<matno_external>ZED00000003</matno_external>
<mat_description>AIMS SEMICONDUCTOR B</mat_description>
</MaterialLine>
</item>
</ns:MaterialData>
Hi Shaun,
See this..
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
cheers,
Prashanth
P.S Please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all for your attempts but I figured it out and wasn't this the biggest case of irony.
Here I was trying to prevent leading spaces from being trimmed in the loading of my file and my problem was that when I typed:
MaterialLine.fieldContentFormatting
I actually left a "blank" at the end of the "g" in Formatting. Apparently XI didn't like that and neither gave me a runtime or compile error. Anyway I found this and though I'd share in case anyone else encounters it. I removed the blank and all is working now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apparently IE strips the whitespace also. So I'm reposting my input file example. In the file below assume "#" equals " ".
ZED00000001#############################AIMS LIGHT A
#ZED00000001############################AIMS LIGHT B
ZED00000002#############################AIMS SWITCH A
#ZED00000002############################AIMS SWITCH B
ZED00000003#############################AIMS SEMICONDUCTOR A
#ZED00000003############################AIMS SEMICONDUCTOR B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
As you assumed, I was checking the source via SXMB_MONI. Per your note I cut/pasted into notepad and saw the same results (trimmed leading blanks). The then saved the source in SXMB_MONI to an xml file and checked with notepad and still the same results.
Yes I am doing fixed length file content conversion.
Thanks for your reply.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.