cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion Removes Leading Blank/Space

Former Member
0 Kudos

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>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shaun,

See this..

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

cheers,

Prashanth

P.S Please mark helpful answers

Former Member
0 Kudos

Hi Prashanth,

Appreciate you taking the time to reply but unless I'm missing something I don't think it helps my situation since I'm using fixed length and not delimited.

I do appreciate your try however.

Thanks,

Shaun

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

moorthy
Active Contributor
0 Kudos

HI,

DId you check the source of this xml message from the SXMB_MONI ? I think this space will not visible in the SXMB_MONI in xml format.

If you save this in a notepad and view the source, you can see that...

Are you doing fixed length file content conversion ?

Regards,

moorthy

Former Member
0 Kudos

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.