cancel
Showing results for 
Search instead for 
Did you mean: 

XI 3.0 XML-->File content conversion

Former Member
0 Kudos

Hi,

We are currently using XI 3.0 SP9, I have the following XML document that I wish to covert to a fixed length file using content conversion (One header line followed by a line for each PIITEM):-

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

<ns:PICount xmlns:ns="XML2FileConversion">

<Site>AAAA</Site>

<PIRef>1234567890</PIRef>

<PIDoc>1234567890</PIDoc>

<PIYear>2005</PIYear>

<SLoc>0001</SLoc>

<SLocDesc>1234567890</SLocDesc>

<PIDate>20050509</PIDate>

<PIItem>

<SKU>123456789012345678</SKU>

<PILine>001</PILine>

</PIItem>

<PIItem>

<SKU>123456789012345678/SKU>

<PILine>002</PILine>

</PIItem>

</ns:PICount>

I have set-up a receiver communication channel with the following parameters :-

Recordset structure ns:PICount, PIItem

ns:PICount.fieldFixedLengths 4,10,10,4,4,10,8

PIItem.fieldFixedLengths 18,3

ns:PICount.endSeparator 'nl'

PIItem.endSeparator 'nl'

ns:PICount.fixedLengthTooShortHandling Cut

PIItem.fixedLengthTooShortHandling Cut

ns:PICount.addHeaderLine No

PIItem.addHeaderLine No

When I send the XML message I get the following message appear on the adapter log :-

Consistency error: more fields found in XML structure than specified in conversion parameters! Value '12345678901234567890')'

Any ideas how to get round this problem?

Regards

Ian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ian,

The problem is that the Recordset Structure name should be <b>PICount</b> not <b>ns:PICount</b>.In XML document the <b>ns</b> which is coming is the root name and is never included in Recordset structure name.Thus change the name to PICount and check it

Second problem which i can see is that

<b>ns:PICount.addHeaderLine No</b>

instead of "NO" value in this you should give <b>"0"</b>

which is used for no header line.

Please make these changes and try it again.

Hope it help you.

Don't forget to give points.

Regards

Arpit Seth

Former Member
0 Kudos

actually - addHeaderLine can only be specified if you have just one structure, per the documentation.

I wonder if the problem is that the structure is nested - ie your line is under the Count? What if they're on the same level? Is it considering the start of the line as another attribute of the header? We have had many problems in the other direction (flat file to XML) with this type of nesting.

Former Member
0 Kudos

Copy/paste from the help site - note what I bolded...

If you have selected File Content Conversion under Message Protocol, you can convert a table in XML format to pure text format in this mode. <b>The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes</b>.

However, I heard with SP11, you can do structure conversion - I'm on SP11 now, and I'm trying it... Sometimes the documentation is a bit behind.

Former Member
0 Kudos

Ok, I recreated... unless there's something new that I haven't figured out, you can't nest your structure. Rather than

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

<ns:PICount xmlns:ns="XML2FileConversion">

<Site>AAAA</Site>

<PIRef>1234567890</PIRef>

<PIDoc>1234567890</PIDoc>

<PIYear>2005</PIYear>

<SLoc>0001</SLoc>

<SLocDesc>1234567890</SLocDesc>

<PIDate>20050509</PIDate>

<PIItem>

<SKU>123456789012345678</SKU>

<PILine>001</PILine>

</PIItem>

<PIItem>

<SKU>123456789012345678/SKU>

<PILine>002</PILine>

</PIItem>

</ns:PICount>

You have to bring the Items out...

<b><ns:PICount</b> xmlns:ns="XML2FileConversion">

<Site>AAAA</Site>

<PIRef>1234567890</PIRef>

<PIDoc>1234567890</PIDoc>

<PIYear>2005</PIYear>

<SLoc>0001</SLoc>

<SLocDesc>1234567890</SLocDesc>

<PIDate>20050509</PIDate>

<b></ns:PICount></b>

<PIItem>

<SKU>123456789012345678</SKU>

<PILine>001</PILine>

</PIItem>

<PIItem>

<SKU>123456789012345678/SKU>

<PILine>002</PILine>

</PIItem>

And then you are ok - I re-ran the test having the structures "separate" rather than nested, and that worked. If you only have these 2 pieces in your XML, you are ok. Anyone with more complex structures won't be able to use content conversion (unless it's being beefed up to be a bit slicker...) Let me know if this doesn't make sense...

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Amanda,

I have checked and their are no spaces between the structure names or the field lenghts. You mention adding the field names to the communication channel. According to the SAP help found in

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm

there is no parameter for the field names.

Thanks for your help

Ian

Former Member
0 Kudos

These are always fun.

Make sure there are no spaces between your lengths & the commas. I have never specified field fixed lengths without specifying the field names - I am going to set up something similar & run a few tests, but try getting your field names in there & see if that works.

Former Member
0 Kudos

also - if you copy/pasted - no space between the 2 structure names...

Former Member
0 Kudos

You're right - my bad mixing up the sender/receiver junk. Have you tried data with only one line? Part of the problem we've had is that although the sender config for structures is good, the receiver examples aren't so complex...

Let me know your value for conversionType? All the examples we have found are SimpleXML2Plain - wonder if it's a struct thing - still attempting to set up a test...