Skip to Content

XI 3.0 XML-->File content conversion

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 10, 2005 at 01:46 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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...

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2005 at 07:16 PM

    😊 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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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...

  • Posted on May 10, 2005 at 08:53 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.